Applying this change:
'/service-worker.js' // ❌
'./service-worker.js' // ✅
fixed my issue.
(in navigator.serviceWorker.register('/service-worker.js')
)
Or maybe you need:
'%PUBLIC_URL%/serviceworker.js'
Thank @DanielLord for his comment.
More Related Contents:
- Trying to use fetch and pass in mode: no-cors
- The create-react-app imports restriction outside of src directory
- ReactJS – Lifting state up vs keeping a local state
- npm start error with create-react-app
- How do you send images to node js with Axios?
- Development server of create-react-app does not auto refresh
- where is create-react-app webpack config and files?
- Where’s the connection between index.html and index.js in a Create-React-App application?
- Best way to polyfill ES6 features in React app that uses create-react-app
- How to use create-react-app with an older React version?
- Increase JavaScript Heap size in create-react-app project
- Jest – SyntaxError: Cannot use import statement outside a module
- Mock inner axios.create()
- create-react-app is showing all my code in production, how to hide it?
- “SyntaxError: Unexpected token < in JSON at position 0"
- How to enable cors nodejs with express?
- React – User-Defined JSX Components Not rendering
- How to access a child’s state in React
- Is there any way to update a specific index from the array in Firestore
- Detecting when user scrolls to bottom of div with React js
- Executing async code on update of state with react-hooks
- How to change the value of a Context with useContext?
- Listen on HTTP and HTTPS for a single express app
- Event target is null inside functional setState
- Sort an array of objects in React and render them
- How can I update an object inside of an array in firestore? [duplicate]
- Handlebars: Access has been denied to resolve the property “from” because it is not an “own property” of its parent
- Express: Setting content-type based on path/file?
- minimise the code since I am using the same code only the content in p tags changes and component AccordionHeader header changes
- React props: Should I pass the object or its properties? Does it make much difference?