I am writing a plugin for Moodle as part of a university project. Currently, I cannot get a basic AMD module setup to work within my plugin, the purpose of using an AMD module is to eventually run a plotly javascript chart library. In the browser an error occurs when loading the "module.js" file via "view.php".
Here is my github repositry .
I have been writing the AMD module based on the following guides:
- https://docs.moodle.org/dev/Guide_to_adding_third_party_jQuery_for_AMD
- https://learn1.open.ac.uk/mod/oublog/viewpost.php?post=164813
Using NPM Grunt, I generated the "module.min.js" and "module.min.js.map" files which appears to have worked correctly. However, when I call the js_call_amd() function in "view.php", an 'Uncaught SyntaxError' appears in the browser.
Can I get some advice, as to why the AMD module is not running? Any suggestions would be really helpful.
Thanks,
Ben