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

Error: Could not load stylesheet (timeout) #5676

Closed
wardpeet opened this issue Jul 17, 2018 · 3 comments
Closed

Error: Could not load stylesheet (timeout) #5676

wardpeet opened this issue Jul 17, 2018 · 3 comments

Comments

@wardpeet
Copy link
Collaborator

wardpeet commented Jul 17, 2018

I was checking sentry I saw that we got hit by this error quite a bit. About 12000 a day.

The issue is still CORS. We should throw Could not load stylesheet with CORS but we throw Could not load stylesheet (timeout). We should add an addEventListener('error' to the mix to track these errors correctly.

The above issue fixes logging the correct message but it won't fix these errors. The issue lies that we call the stylesheet with crossorigin="anonymous" and that chrome expects a 'Access-Control-Allow-Origin': '<value>' header which a lot of sites do not set as it's unnecessary.

Some options:

  1. we read the raw data of the network record and do a regex on the raw text of the file. More error prone than cssStylesheet where parsing is already done
  2. Override ACAO header with requestIntercepted unsure if this works.

https://sentry.io/google-lighthouse/lighthouse/issues/596333623/

Error: Could not load stylesheet (timeout)
  File "/usr/lib/node_modules/lighthouse/lighthouse-core/gather/gatherers/fonts.js", line 218, in fontsAndErrors.filter.fontOrError
    const err = new Error(dataError.err.message);
  ?, in Array.filter
  File "/usr/lib/node_modules/lighthouse/lighthouse-core/gather/gatherers/fonts.js", line 213, in fontData.then
    const fontFaces = /** @type {Array<LH.Artifacts.Font>} */ (fontsAndErrors.filter(
  ?, in null.<anonymous>
  File "internal/process/next_tick.js", line 182, in process._tickCallback

Error: Could not load stylesheet (timeout)
@wardpeet
Copy link
Collaborator Author

@paulirish @brendankenny how do you feel about these 2 options?

@exterkamp
Copy link
Member

Was this fixed as part of #6166?

@patrickhulce
Copy link
Collaborator

Yep should've been fixed by #6166

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