question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

serviceWorker.js file missing after running npx create-react-app

See original GitHub issue

I’ve run the npx create-react-app command twice and both times the serviceWorker.js file is missing under the /src directory. So when I try to import * as serviceWorker from ‘./serviceWorker’ I get a module not found error.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
fkhan698commented, Nov 20, 2020

Try running npx create-react-app my-app --template cra-template-pwa

1reaction
GiovanniGiampaolocommented, Dec 7, 2020

I’ve run the npx create-react-app command twice and both times the serviceWorker.js file is missing under the /src directory. So when I try to import * as serviceWorker from ‘./serviceWorker’ I get a module not found error.

For TS npx create-react-app my-app --template cra-template-pwa-typescript

Read more comments on GitHub >

github_iconTop Results From Across the Web

serviceWorker missing from ReactApp - reactjs - Stack Overflow
Hi All I realized just recently when CRA(npx create-react-app myapp) , serviceWorker is missing from ...
Read more >
ServiceWorker not built in 4.x (next) #9776 - GitHub
The file is missing. This causes a problem with apps which are upgrading from prior CRA versions, as they continue to reference the...
Read more >
Where is the Service Worker in a Create React App (CRA)
js file inside the src directory, you will see that by default, the service worker is not registered. So let's first register the...
Read more >
PWA with Create React App and service workers
Go to the src/index. js file in your project and find the following lines of code: // If you want your app to...
Read more >
Service worker isn't working? Here's a small detail you might ...
You might want to try the index.js file in the src folder. At the very last line (if you haven't modified anything), you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found