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

Blank html reports with temporary-public-storage option #431

Closed
danipv opened this issue Aug 27, 2020 · 3 comments
Closed

Blank html reports with temporary-public-storage option #431

danipv opened this issue Aug 27, 2020 · 3 comments

Comments

@danipv
Copy link

danipv commented Aug 27, 2020

Hello team,

I'm getting blank html reports when I use the upload target temporary-public-storage. The html exist but it does not show anything, but if you inspect the code there is a json object that actually contains some data.

Example of blank report url: https://storage.googleapis.com/lighthouse-infrastructure.appspot.com/reports/1598532639659-25984.report.html

This is the basic config I use to reproduce the error:

module.exports = {
  ci: {
    collect: {
      chromePath: './chrome-linux/chrome',
      url: [
        'http://localhost:8081/home/',
      ],
    },
    upload: {
      target: 'temporary-public-storage',
    },
  },
};

lhci: @lhci/cli@0.5.0
chrome linux: Chromium 87.0.4247.0 (https://download-chromium.appspot.com/dl/Linux_x64?type=snapshots)

Thanks a lot!

@danipv danipv changed the title Blank reports Blank html reports with temporary-public-storage option Aug 27, 2020
@danipv
Copy link
Author

danipv commented Aug 27, 2020

Well, I dig a little bit more in the issue. Seems to be a render problem. When the function renderSourceLocation receive an item like this:

item: {


  column: 85,

  line: 0,
  
type: "source-location",
  
url: "data:text/javascript;charset=utf-8,%22use%20strict%22%3Bfunction[…]",
}

When url property doesn't contains a canonical url, the snippet generated by the inner function renderTextURL doens't have an a element and the function throws an error.

Maybe this is a solution if I'm not missing something.

- if (item.urlProvider === 'network') {
+ if (item.urlProvider === 'network' && item.url.indexOf('data:text/javascript') === -1) {
      element = this.renderTextURL(item.url);
      this._dom.find('a', element).textContent += `:${line}:${column}`;
    } else {
      element = this._renderText(`${item.url}:${line}:${column} (from sourceURL)`);
    }

Happy to open a PR if you approve this solution.

@danipv
Copy link
Author

danipv commented Aug 27, 2020

Seems to be is solved here: GoogleChrome/lighthouse#11299.

@danipv danipv closed this as completed Aug 27, 2020
@patrickhulce
Copy link
Collaborator

Thanks for doing the digging @danipv! That is indeed the fix for this particular bug :)

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

2 participants