Hi everyone, I am migrating some plugin from elgg 5 to elgg 6.
In my Bootstrap.php, I registered an ES Module this way.
elgg_register_esm('jitsi-external-api-js', 'https://meet.jit.si/external_api.js');
In my .mjs file I imported the ES Module this way.
import 'jitsi-external-api-js';
But when open the page where the module is imported I got the following error.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://meet.jit.si/external_api.js. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
Module source URI is not allowed in this document: “https://meet.jit.si/external_api.js”.
Could someone help me ?
When I loaded the same js (https://meet.jit.si/external_api.js) from elgg 5 it works perfectky.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Jerome Bakker@jeabakker
Jerome Bakker - 0 likes
You must log in to post replies.Have you looked at https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors
The main reason is the external site (jit.si) doesn't allow the inclusion. No idea why it worked in Elgg 5 and not 6. Maybe the ESM modules (because they are browser native) are more secure than RequireJS was.