Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

URL is not defined

See original GitHub issue

I followed the instructions in step 4 of the README to get the automated benchmark driver running, and everything installed without errors.

I’ve successfully built and run the keyed/preact benchmark via the web-server.

I then tried to run the benchmark under the webdriver-ts, and it fails:

$ npm run bench keyed/preact

> webdriver-ts@1.0.0 bench /mnt/c/workspace/js-framework-benchmark/webdriver-ts
> cross-env LANG="en_US.UTF-8" node dist/benchmarkRunner.js "keyed/preact"

class URLShim extends URL {

ReferenceError: URL is not defined
    at Object.<anonymous> (/mnt/c/workspace/js-framework-benchmark/webdriver-ts/node_modules/lighthouse/lighthouse-core/lib/url-shim.js:35:23)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object.<anonymous> (/mnt/c/workspace/js-framework-benchmark/webdriver-ts/node_modules/lighthouse/lighthouse-core/lib/network-request.js:14:13)
    at Module._compile (internal/modules/cjs/loader.js:654:30)

Looks like a similar problem was reported and fixed earlier in #593.

But it looks like we’re still missing a URL polyfill for node or something?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

krausestcommented, Dec 14, 2019

Closing it - since last test on windows looked “good” (not including the delay…)

krausestcommented, Oct 20, 2019

An alternative would be to try the docker build as explained in the wiki. I tested it since yesterday on windows. It worked fine on my machine, but it takes literally days to run all benchmarks. After 14 hours all keyed implementations were done. If you decide to give it a shot please tell me about your experience with it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

URL is not defined in node.js - Stack Overflow
Try to add this line: var URL = require('url').URL;. The full example is here: var URL = require('url').URL; var myURL = new ...
Read more >
ReferenceError: URL is not defined [Temporary fix] · Issue #859
Hello, i am using the current version 4.4.3, i am getting ReferenceError: URL is not defined i had to comment out line 84...
Read more >
ReferenceError: URL is not defined - Nehemiah Blog
If you are using Node 8.11.2-x64, you may experience the below error when trying to fetch client packages like bootstrap or jquery from...
Read more >
Uncaught ReferenceError: url is not defined - JavaScript
I'm attempting to parse the URL into a variable, but I receive the following error: Uncaught ReferenceError: url is not defined.
Read more >
URL | Node.js v19.3.0 Documentation
WHATWG URL's origin property includes protocol and host , but not username or password . ... Removes the stored <Blob> identified by the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found