Skip to content

Conversation

@patrickhulce
Copy link
Collaborator

Related Issues/PRs
fixes #5273

// browerify's url shim doesn't work with .URL in node_modules, so expose our own
// @see https://github.com/GoogleChrome/lighthouse/issues/5273
const pathToURLShim = require.resolve('../lighthouse-core/lib/url-shim.js');
bundle = bundle.require(pathToURLShim, {expose: 'url'});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this lowercase usage of it used? i'm not following what the fix is here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inside robots-parser it does var URL = require('url').URL

}
}

URLShim.URL = URL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who uses URL.URL?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robots parser, see above :)

Copy link
Contributor

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, this definitely only adds to the url-shim browserify confusion but I can't think of a better solution so LGTM :)

we do expose ourselves to some possible future bugs if we end up using a module that uses require('url').parse() or whatever, but there's not a great solution available and hopefully everyone will be using the global URL soon enough...

@paulirish paulirish added the 3.0 label May 23, 2018
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

Successfully merging this pull request may close these issues.

SEO - Page is blocked from indexing - robots.txt

3 participants