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

Incorrect error reporting when using link preload #10381

Open
valodzka opened this issue Feb 24, 2020 · 5 comments
Open

Incorrect error reporting when using link preload #10381

valodzka opened this issue Feb 24, 2020 · 5 comments
Assignees
Labels
bug P1.5 PSI/LR PageSpeed Insights and Lightrider

Comments

@valodzka
Copy link

Describe the bug
Incorrect error reported "Browser errors were logged to the console"

To Reproduce

  1. Run web.dev audit with 'https://condescending-haibt-2d0d42.netlify.com/bug.html' (page uses link: </empty.js>; rel="preload"; as="script"; crossorigin="anonymous" header)

  2. In the report there are incorrect error "Browser errors were logged to the console":

    /empty.js(condescending-haibt-2d0d42.netlify.com) | Failed to load resource: net::ERR_ACCESS_DENIED
    

Expected behavior
There should not be such error

Report: https://lighthouse-dot-webdotdevsite.appspot.com//lh/html?url=https://condescending-haibt-2d0d42.netlify.com/bug.html

@robdodson robdodson transferred this issue from GoogleChrome/web.dev Feb 26, 2020
@wardpeet
Copy link
Collaborator

Web.dev does indeed give you the failed to load resource error. CLI seems to be working correctly & audit panel in chrome too.

The cli gives me an error of a missing favicon.
image

@connorjclark
Copy link
Collaborator

connorjclark commented Feb 27, 2020

Thanks for the report @valodzka i'll check it out.

@wardpeet the favicon is a separate issue - we run headless chrome which will never request a favicon. we've removed favicon from perf budgets #10190 but we should also go a bit further I think ... can you open an issue for this? I'd expect the favicon request to not even be made ...

@connorjclark
Copy link
Collaborator

@valodzka that's weird! could you add a second js file (and also preload it), but give it some content in the body? just console.log('hi'); is enough. curious if the response body being empty matters (it probably doesn't but I wanna rule it out).

I see it is blocked b/c of CSP.

devtools log:

 {
      "method": "Network.requestWillBeSent",
      "params": {
        "requestId": "99.14",
        "loaderId": "FA85E2BBFA7F81CF38584B9238265CE1",
        "documentURL": "https://condescending-haibt-2d0d42.netlify.com/bug.html",
        "request": {
          "url": "https://condescending-haibt-2d0d42.netlify.com/empty.js",
          "method": "GET",
          "headers": {
            "Referer": "https://condescending-haibt-2d0d42.netlify.com/bug.html",
            "Origin": "https://condescending-haibt-2d0d42.netlify.com"
          },
          "mixedContentType": "none",
          "initialPriority": "High",
          "referrerPolicy": "no-referrer-when-downgrade",
          "isLinkPreload": true
        },
        "timestamp": 295580.719805,
        "wallTime": 1582840710.451049,
        "initiator": {
          "type": "other"
        },
        "type": "Script",
        "frameId": "42EB25EC22BCF905D8B8F8FA777DBDDA",
        "hasUserGesture": false
      }
    },
    {
      "method": "Network.loadingFailed",
      "params": {
        "requestId": "99.14",
        "timestamp": 295580.71981,
        "type": "Script",
        "errorText": "",
        "canceled": false,
        "blockedReason": "csp"
      }
    },

which seems wrong ... it's the same origin. That may be our bug.

@valodzka
Copy link
Author

give it some content in the body?

Added. Empy or not it doesn't matter.

@patrickhulce
Copy link
Collaborator

patrickhulce commented Apr 28, 2020

P1.5 because this seems like a legit PSI infra bug that deserves to be looked into.


edit by paul: it's possible #7163 is related?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P1.5 PSI/LR PageSpeed Insights and Lightrider
Projects
None yet
Development

No branches or pull requests

5 participants