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

create-react-app does not create serviceWorker #19

Closed
Poikilos opened this issue Dec 5, 2020 · 2 comments
Closed

create-react-app does not create serviceWorker #19

Poikilos opened this issue Dec 5, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@Poikilos
Copy link
Owner

Poikilos commented Dec 5, 2020

No description provided.

@Poikilos Poikilos added the bug Something isn't working label Dec 5, 2020
@Poikilos
Copy link
Owner Author

Poikilos commented Dec 5, 2020

This issue is due to changes in creat-react-app.

Resolve as per facebook/create-react-app#10032:

  1. In a new directory, run
    npx create-react-app my-app --template cra-template-pwa

2 Copy the service-worker.js from the new created app into your src directory

3 Copy the "workbox-*" dependencies from the package.json into your package.json dependencies

4 (Optional) If you want web-vitals, copy the web-vitals dependency from package.json into your package.json

and don't forget to run again 'yarn install' or 'npm install'

- a-tonchev

@Poikilos
Copy link
Owner Author

Poikilos commented Dec 5, 2020

It generates serviceWorkerRegistration instead. The index.js file shows how to use it.

Poikilos added a commit that referenced this issue Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant