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

The page provided is not HTML (served as MIME type ) #12125

Closed
ms-fadaei opened this issue Feb 23, 2021 · 3 comments
Closed

The page provided is not HTML (served as MIME type ) #12125

ms-fadaei opened this issue Feb 23, 2021 · 3 comments

Comments

@ms-fadaei
Copy link

Provide the steps to reproduce

  1. Run LH on LOCALHOST URL (lighthouse CI)
  2. Use Gitlab (to run LHCI)
  3. Use Nuxt as Framework

.gitlab-ci.yml

lighthouse-test:
  stage: test
  script:
    - echo "Start Lighthouse Test"
    - npm install
    - npm run build:modern
    - npm install -g @lhci/cli@0.7.x
    - lhci autorun
    - echo "End Lighthouse Test"

.lighthouserc.js

module.exports = {
  ci: {
    collect: {
      url: ['http://localhost:3020', 'http://localhost:3020/refrigrator'],
      startServerCommand: "npm run start --modern",
      settings: {
        chromeFlags: "--no-sandbox --ignore-certificate-errors"
      }
    },
    upload: {
      target: 'temporary-public-storage',
    },
  },
};

What is the current behavior?

I get The message "The page provided is not HTML (served as MIME type )" when I use LHCI in my GitLab repository.
I get this message just in a certain route (localhost:3020/:id) but when I run LHCI on localhost:3020 the report was generated.
Then I check the routes on my local machine (run LHCI locally) and there is no problem at all and the reports generated for all of my pages.

I Also checked my URL headers and all parameters in localhost:3020/:id and localhost:3020 are equals to:

Link                      <https://cdn.aXXXXXXh.ir/>; rel=preconnect
Server-Timing       total;dur=9;desc="Nuxt Server Time"
Vary                      Accept-Encoding
Connection           keep-alive
Accept-Ranges     none
Content-Length    42724
Content-Type        text/html; charset=utf-8
Date                      Tue, 23 Feb 2021 15:36:07 GMT
ETag                      "a6e4-jFotdEri3dRKeU/ak8jKSug2N8U"
Set-Cookie            __Host-auth.strategy=local; Path=/; Secure; SameSite=Lax

What is the expected behavior?

I want the report to be generated.
In my local machine, all things work well.
In my GitLab repository, one URL work well but another not!

Environment Information

  • Affected Channels: CI
  • Lighthouse version: 7.0.0
  • Chrome version: 86
  • Node.js version: 14.15
@patrickhulce
Copy link
Collaborator

Thanks for filing @ms-fadaei!

Are you able to share the exact output of curl -vvvv http://<whatever URL is failing> test.log 2>&1 from your CI? From the information here, it sounds like the content-type header is not on that URL and instead the MIME type was not inferred from the response body.

@patrickhulce patrickhulce removed their assignment Feb 23, 2021
@ms-fadaei
Copy link
Author

Thanks for your guide...

I figured out what is the problem!
my server returns text/JSON on internal error so LHCI hasn't any problem.

Thanks again

@fdelapena
Copy link

Some of the possible causes, I can confirm I'm hitting the 3rd (using H2 Early Hints on my Apache httpd server). This affects also online products such Google PageSpeed Insights, Think With Google's Test My Site, web.dev Measure, etc.

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

No branches or pull requests

4 participants