-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Regression bug introduced by the PR #8940 related to the bug #8729.
Problem :
The PR is based on the fact that 'document.currentScript.src' exists in ES6 modules.
This is not the case for VanillaJS ( no magic bundling ) for Firefox>=68 and Chrome>=76.
This causes any import of ES6 module which is not in the same directory that the source html file to fail.
Reproduce :
Generate a ES6 WASM + js hello_world in a subdirectory
Create a parent main.html page + main.js vanillaJS ES6 module in a parent directory
Import the hello_world from the main.js.
It will fail: The hello_world.js will not succeed to fetch the WASM file.
Temporary Fix :
Override the "locateFile" in the Module itself with a callback that enforce the WASM module path
Definitive Fix:
Enforce the usage of PTHREAD and WebWorker is not a good solution considering that this support is disable in almost all the main WebBrowser for now.
I would be for adding a flag to disable "import.meta.url" on demand. And enable it by default for ANY ES6_MODULE.