Closed LukeTOBrien closed 2 months ago
I have just cloned my project onto a new machine and updated Parcel the 2.6.2 from 2.0.0-rc.
Here is my tsconfig, perhaps I need to update that also?
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": false,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"esModuleInterop": true,
"target": "es2019"
}
}
how to fix it?
how to fix it?
I got this issue @parcel/transformer-js: Registering service workers with a string literal is not supported.
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.
This error is wrong and is causing the build to fail.
π¨ Build failed.
@parcel/transformer-js: Registering service workers with a string literal is not supported.
C:\VB Azure\EntERPro\UI\ASP\static\Script\scripts-main.ts:21:38
20 | window['$'] = window['jQuery'] = jquery;
> 21 | window['functions'] = Functions;
> | ^
22 |
23 | VhFix();
π‘ Replace with: new URL('service-worker.js', import.meta.url)
π Learn more: https://parceljs.org/languages/javascript/#service-workers
@mischnic What do you think?
Also seeing this on windows. Going to try the hacky workaround!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
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