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.

The script has an unsupported MIME type ('text/html')

See original GitHub issue

Hi I’ve written a small project with create-react-app, it runs in the browser ‘http://localhost:3000/’ with ‘npm start’ but i’m seeing these two errors in the console:

The script has an unsupported MIME type ('text/html').  :3000/service-worker.js:1
GET http://localhost:3000/service-worker.js net::ERR_INSECURE_RESPONSE  :3000/service-worker.js:1

this is my package.json

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "react-scripts": "0.4.1"
  },
  "dependencies": {
    "react": "^15.3.1",
    "react-dom": "^15.3.1",
    "react-redux": "^4.4.5",
    "redux": "^3.6.0"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "./node_modules/react-scripts/config/eslint.js"
  },
  "standard": {
    "globals": [
      "describe",
      "context",
      "before",
      "beforeEach",
      "after",
      "afterEach",
      "it",
      "expect"
    ]
  }
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

44reactions
n3trcommented, Dec 11, 2016

Maybe I’m wrong, the error is about service worker has been register for localhost:3000.

Can you open Chrome Dev Tools -> Application -> Service Worker and see if you have a service worker has been registered? If yes click unregister and refresh the page again.

1reaction
rob-yoticommented, Dec 7, 2016

I got this issue after running npm run build on a new app, and moving the build folder to my express application which then served it.

It appears the helmet middleware was interfering with the client side caching, so if you have this issue on a node server, it may be worth checking this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service Worker registration error: Unsupported MIME type ...
The script has an unsupported MIME type ('text/html'). Failed to load resource: net::ERR_INSECURE_RESPONSE ( ...
Read more >
Error: Service worker has an unsupported MIME type ('text ...
My understanding of the MIME type error is that indicates that the service worker did not register correctly. I just ran npx create-react-app...
Read more >
The script has an unsupported MIME type ('text/html')
I get following error: The script has an unsupported MIME type ('text/html'). service worker error DOMException: Failed to register a ...
Read more >
The script has an unsupported MIME type ('text/js')
I am getting error in the browser console The script has an unsupported MIME type ('text/js') and also getting Registration failed with SecurityError: ......
Read more >
service-worker - Unsupported MIME type ('text/html') - iTecNote
I'm using create-react-app with an express server. create-react-app has a pre-configured ServiceWorker that caches local assets ...
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