-
Notifications
You must be signed in to change notification settings - Fork 60
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
Plugin esmUrl
may not work in web worker with relative paths
#3262
Comments
If I add some console logging, it also gives this error "Error: Dynamic module import is disabled or not supported in this context"
|
note: "Dynamic module import is disabled..." may be firefox specific (you might notice a number of firefox specific bugs being reported, i've been trying it out more) but I think the 404 applies to chrome also xref for firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1540913 |
I think that the ability to resolve relative paths got messed up when we converted to webpack 5 In our webpack4/worker-loader case, the worker files were outputted to e.g. products/jbrowse-web/public/ With this, the window.location.href and the "workerSelf.location.href" were both the public directory, so purportedly, "relative" paths could be specified at least relative to the index.html of the jbrowse-web instance. Now, with webpack 5, the worker files are now outputted to e.g. products/jbrowse-web/public/static/js/ so that is why we get the request for e.g. the 404 at We might be able to supply an explicit path to resolve the plugin file relative to for the worker IMO it may also be useful to resolve the plugin relative to the current "directory of the config.json file" but that could be an add on If it was in the directory of the config, we could have e.g. in test_data/volvox/config.json the json |
I think that we should probably add a no-build plugin example to our volvox config so that it helps us get more treading/testing of the no-build case |
Example from editing volvox config
config.json
Editing PluginLoader to log the URL
On the main thread, it resolves to http://localhost:3000/test_data/volvox/hex_plugin.js but on the web worker it resolves to http://localhost:3000/static/js/test_data/volvox/hex_plugin.js and produces a 404, but no error is caught and the track goes into infinite loading
The text was updated successfully, but these errors were encountered: