-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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: Registering service workers with a string literal is not supported. - Importing jquery #8307
Comments
I have just cloned my project onto a new machine and updated Parcel the 2.6.2 from 2.0.0-rc. {
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": false,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"esModuleInterop": true,
"target": "es2019"
}
} |
how to fix it? |
I got this issue |
I worked around this by putting the serviceWorker object in a separate reference: const s = navigator.serviceWorker
s.register('worker.js') This tricks Parcel, but it works for me (for now). There are probably some issues down the line with this. |
I am not using service workers at all, I am just importing jQuery. I think I remember 'solving' this issue by reverting back to ParcelJS 2-beta... Now I made the mistake of updating to 2.8 and I see this issue is still present.
|
@mischnic What do you think? |
Also seeing this on windows. Going to try the hacky workaround! |
Hello
I am getting the following error whilst importing jQuery and assigning it to a variable:
My script is:
🤔 Expected Behavior
I should be able to import jQuery and assign it to a global variable.
The error message shouldn't mention service workers when they are not being used
🌍 Your Environment
The text was updated successfully, but these errors were encountered: