I'm not sure if this is a bug or missing documentation or if I just haven't read the correct parts of the documentation so if this is not a bug, sorry for opening this ticket:
<script … data-sap-ui-oninit="module:com/example/cool-app/init">
UI5 should load the module and execute it, like descriped in the announcement or the docs.
UI5 tries to globalEval the "module:..." sting, which fails.
This may be intended if a "-" in a module name should not be allowed, but I guess this should be checked in a lof of other places as well then.
Heres what causes the issue:
https://github.com/SAP/openui5/blob/c44885a2bb18d1238c79fffac02a42cb4d9e0b05/src/sap.ui.core/src/sap/ui/core/Core.js#L1115
The rexexp does not include the - character.
Adding a - to the end of the last character class should fix the issue:
var aResult = /^module\:((?:(?:[_$a-zA-Z][_$a-zA-Z0-9-]*)\/?)*)$/.exec(vOnInit);
Hi Mark,
thanks for reporting this issue. We will extend the regex soon for the - and for more characters which are allowed on our supported platforms.
I will take care to fix the issue.
BR,
Peter
The issue will be fixed soon in master, 1.56 and 1.54