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

(Core)URLShim inheritance issue #9448

Closed
hunterbreathat-wk opened this issue Jul 24, 2019 · 4 comments
Closed

(Core)URLShim inheritance issue #9448

hunterbreathat-wk opened this issue Jul 24, 2019 · 4 comments

Comments

@hunterbreathat-wk
Copy link

Provide the steps to reproduce

  1. launch lighthouse in js ex.
    browser is already launched
lighthouse('https://google.ca',{port:50855},null).then(report =>{
//do something
});

What is the current behavior?

Error stating

class URLShim extends URL {
                      ^
ReferenceError: URL is not defined
    at Object.<anonymous> (/usr/local/lib/node_modules/lighthouse/lighthouse-core/lib/url-shim.js:35:23)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/lighthouse/lighthouse-core/lib/network-request.js:14:13)
    at Module._compile (module.js:652:30)

What is the expected behavior?

To launch lighthouse based on inputted site, in this case, google.ca as an example

Environment Information

  • Affected Channels: Node
  • Lighthouse version: 5.1.0
  • Node.js version: 12.6.0, npm: 6.10.2
  • Operating System: MacOsX Mojave

Possible way to fix

const URL = require('url'); appended to file

Related issues

@hunterbreathat-wk hunterbreathat-wk changed the title URLShim inheritance issue (Core)URLShim inheritance issue Jul 24, 2019
@paulirish
Copy link
Member

global.URL is a thing as of node 10. https://nodejs.org/api/globals.html#globals_url

Node.js version: 12.6.0,

are you sure you're using node >= 10?

@hunterbreathat-wk
Copy link
Author

hunterbreathat-wk commented Jul 25, 2019 via email

@connorjclark
Copy link
Collaborator

could you upload a repo to github so we can investigate?

@hunterbreathat-wk
Copy link
Author

hunterbreathat-wk commented Jul 25, 2019 via email

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

3 participants