Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RequireJS error 'Script error for "core/autoinitialize" in Totara 13 #766

Open
agwells opened this issue Jul 4, 2023 · 0 comments
Open

Comments

@agwells
Copy link
Member

agwells commented Jul 4, 2023

When this plugin is installed in a Totara 13 site, it causes the requireJS loader to error out.

To replicate:

  1. Set up a clean install of Totara 13
  2. Add auth/saml2 plugin
  3. Access the site in a web browser

Expected result: The site loads successfully
Actual result: The site loads but no JS functionality works. The console shows an error message Uncaught Error: Script error for "core/autoinitialize"

image

A look at the Developer Tools networking tab shows that there was a 500 error from the server attempting to load /lib/requirejs.php/-1/core/bundle.js. The response's body has this content:

JS file: /auth/saml2/amd/src/connectivity_test.js cannot be loaded, or does not contain a javascript module in AMD format. "define()" not found.

image

image

It appears that the cause of this problem is that the file in question, /auth/saml2/amd/src/connectivity_test.js, is an ES5 module rather than an AMD module. Deleting the entire directory /server/auth/saml2/amd/src/ from my Totara source directory resolves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant