Skip to content
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

Uncaught SyntaxError: The requested module /service-worker.js does not provide an export named 'default' #7

Open
tostinni opened this issue Dec 2, 2021 · 2 comments

Comments

@tostinni
Copy link

tostinni commented Dec 2, 2021

After setting up step 3 of the PWA training and fill up service-worker.js we have this error in the console.

Uncaught SyntaxError: The requested module /service-worker.js does not provide an export named 'default'

Any idea how to fix this ?

@DSergii
Copy link

DSergii commented Nov 1, 2023

Any updates after two years? I have got the same error.

@DiegoRicardoValdiviaArreola

In my case I was following the codelab in spanish and it had this line in the main.js file:
import swURL from 'sw:../service-worker.js';

and below it says this:
The import syntax for the service worker URL is required so that our build tool, WMR, can build the service worker correctly. If you don't use WMR, set swURL as the path to your service worker.

So I changed the import line to this and is working now 👍 :
const swURL = '../service-worker.js';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants