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

script has an unsupported MIME type ('text/plain') #41

Open
claytoncarney opened this issue Jul 1, 2019 · 1 comment
Open

script has an unsupported MIME type ('text/plain') #41

claytoncarney opened this issue Jul 1, 2019 · 1 comment

Comments

@claytoncarney
Copy link

claytoncarney commented Jul 1, 2019

Trying to use simplehttp2server as a development server to conduct Lighthouse testing. It is not working because the server is setting content-type for javascript files to 'text/plain' rather than ​'application/javascript'. As a result, the service worker fails to load. How could this issue be resolved?

@claytoncarney
Copy link
Author

OK, got the javascript issue resolved with this config file:

{
  "hosting": {
    "redirects": [
      {
      "source": "http://localhost:5000",
      "destination": "https://localhost:5000",
      "type": 301
      }
    ],
    "headers": [
      {
        "source": "**/*.@(js)",
        "headers": [
          {
            "key": "Content-Type",
            "value": "application/javascript"
          }
        ]
      } 
    ]
  }
}

However, this revealed another Lighthouse issue: redirect http traffic to https. Nothing I've tried works; any http request results in an error:

TLS handshake error from [::1]:50500: read tcp [::1]:5000->[::1]:50500: use of closed network connection

How can this issue be resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant