-
Notifications
You must be signed in to change notification settings - Fork 79
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
Nested workers not resolved correctly output.publicPath is relative #89
Comments
Hiya! This is actually a misconfiguration:
This should fix the issue. Let me know if that worked! |
Thanks for the response. Unfortunately using |
|
I'm having this problem from within a Quasar project (quasar 1.x, webpack 4.x). When I use I've confirmed that if I create a js sub-directory, and move that file in there, then everything works. Inside "js/0.07631c92.worker.js" is this (minified) code:
I imagine So, following the above comment, inside quasar.conf.js, in the build section, I added:
This seems to have done the trick, as now both |
It seems that fix doesn't work for Electron builds, though. Any suggestions would be welcome. It is going to be more complicated to hack around this one, with a packaged-up Electron file, than it was with the web app. (Let me know if I should start a new issue for this.) |
I assume this is a side-effect of Angular's use of this plugin, but I can see how this could affect other setups.
Reproduction Steps
1/ Clone test repo - https://github.com/xenobytezero/worker-plugin-nested-bug.git
2/
npm install
3/
npm run build
4/
npm run testServer
This will start up a HTTP server running on
localhost:5000
and show the following5/ Rename the
serve_bug.json
toserve.json
and rename the existing one to something else6/ Modify the
webpack.config.js
to change theoutput.publicPath
value to bedist/
7/
npm run build
8/
npm run testServer
This will start the HTTP server again and show the following
and if you open DevTools you will see the following
Investigation
I believe the problem lies in the loader.js line 87
The plugin writes the
module.exports
to prefix the path with the Webpack public path (__webpack_public_path__
), which in this case adds a second/dist
onto the path and produces a 404.Also a much less important side effect, nested Workers get a second
.worker
on their built filename. No real effects, just looks weird.Proposal
I've been trying to come up with a solution for this, and I think my lack of Webpack experience is getting in the road. Essentially the path used in the line above should be relative to the source file rather than just the public path.
The text was updated successfully, but these errors were encountered: