Skip to content

Conversation

@ac-mmi
Copy link
Contributor

@ac-mmi ac-mmi commented Sep 19, 2025

This PR fixes a bug where i18next and i18next-http-backend were failing to load on GitHub Pages due to 404 Not Found errors.

Problem

  • The current requirejs.config in js/loader.js points to ../node_modules/... for i18next and its backend.
  • On GitHub Pages, the node_modules directory is not published, so these scripts cannot be loaded.

Solution

  • Updated requirejs.config in js/loader.js to load i18next and i18next-http-backend directly from the jsDelivr CDN.
  • This ensures the files are always available in both local development and GitHub Pages environments.

Benefits

  • Fixes runtime errors (404 Not Found).
  • Ensures i18n support works consistently in the hosted version of Music Blocks.
  • No need to commit vendor files or ship node_modules in the repo.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@walterbender
Copy link
Member

@ac-mmi doesn't this mean that you need to load over the internet under all circumstances? I am thinking of the scenario where you are running a local server, not connected to the net. Maybe we should try local and if it fails, revert to the remote files?

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@ac-mmi
Copy link
Contributor Author

ac-mmi commented Sep 19, 2025

@walterbender I’ve updated loader.js to first try loading i18next and the backend from the local lib/ folder, and only fall back to the CDN if those aren’t available. This way it works both offline and online.

@walterbender walterbender merged commit c15f619 into sugarlabs:master Sep 19, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants