-
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
Error when using dynamic imports #43
Comments
I can work around this error by specifying a name in the worker's options:
I'd consider this to be a good-enough workaround. |
hi bro, will your eslint throw error when you use ts with worker-plugin? mine did, and donot know why |
Thanks for the workaround. Just a heads-up to anyone who tries the same: Make sure the type comes after the name. Otherwise it will break because the type is removed from the code and a comma is left behind:
becomes
This will cause bundlers to fail when using the code. |
This shouldn't be closed since workaround is not a real fix. |
Bit by this issue as well, I was providing a name but a non-constant one, so plugin would still go for chunkname === '0'. Easy fix confirmed is to use something else like Happy to PR this 1 line change if anyone with better webpack skills than mine can confirm it's the right ™️ way to go. |
@gluck that actually seems like a pretty good solution. Definitely open to a PR, we can see if it still passes the tests. |
Fixes GoogleChromeLabs#43, as it avoids conflicts with other number-based webpack chunks. Note that the conflict may not be on the filename (since this plugin adds '.worker' to it) but on the internal key used by webpack in referencing modules.
If I include the following in my worker code (assuming dummyModule.js just contains
export default 1
)then I get this error:
Is this something we can work around with worker-plugin's options?
The text was updated successfully, but these errors were encountered: