-
Bug
-
Resolution: Fixed
-
Minor
-
3.6
-
MOODLE_36_STABLE
-
MOODLE_36_STABLE
-
MDL-63763-master -
When "cache javascript" is turned off, Moodle's requirejs.php does not correctly process AMD js files which include usage examples including the text "define(" in comments ahead of the "define(" line.
This results in first.js being incorrectly built to include anonymous defines, and a variety of possible errors, which may appear intermittently. In my case I either had jquery-ui fail to load, or a "mismatched anonymous define" error from require.js, depending on timing.
Either requirejs.php needs to strip comments before processing, or it needs to be documented that AMD modules MUST NOT include the text "define(", even in comments, before the actual module define text.
Currently this only appears to apply to sortable_list.js in core, but it also applies to mod_bootstrapelements/amd/src/instance.js causes and potentially other plugins.
As this is extremely time-consuming to debug, I'd suggest it is important that it be fixed for 3.6, probably best by documentation and the inclusion of a space between "define" and "(" in sortable_list.js comments.
In the long term, requirejs.php needs to be fixed.
- is duplicated by
-
MDL-63736 Commented out define produces "Mismatched anonymous define() module"
-
- Closed
-