Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #6686
Closed
Open
Issue created Mar 19, 2019 by Administrator@rootContributor

Service Worker breaks the app in Firefox

Created by: ketysek

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes, I've tried it on fresh installed app

Which terms did you search for in User Guide?

service worker, progressive web app

Environment

macOS Mojave (10.14.3), Firefox 66.0 (65.0 worked same), current 2.1.8 react-scripts

Steps to Reproduce

  1. create an app (npx create-react-app my-app)
  2. update index.js - instead of serviceWorker.unregister() call serviceWorker.register()
  3. yarn run build
  4. run server with production app code: serve -s -l 3000 build
  5. open localhost:3000 in Firefox
  6. verify that service worker is activated
  7. stop serve server
  8. change something (for example text) in App.js
  9. yarn run build again
  10. run server again
  11. refresh the firefox tab with opened app

Expected Behavior

New service worker should be installed and in waiting state

Actual Behavior

It throws error in console and service worker isn't updated:

Failed to register/update a ServiceWorker for scope ‘http://localhost:3000/’: Bad Content-Type of ‘text/html’ received for script ‘http://localhost:3000/precache-manifest.5df49f687d80bec80e0acf86555252db.js’. Must be a JavaScript MIME type.

When I unregister service worker from Firefox and refresh the tab, it's again working for first time - then you refresh the tab (immediately) for the second time and it again throws the same error in console and also crashes (doesn't display the app) with another error in console:

SyntaxError: expected expression, got '<'[Learn More] main.5f3bc8a8.chunk.js:1

Assignee
Assign to
Time tracking