question-mark
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.

webidl upgrade broke API in 8.2.0

See original GitHub issue

I’m not at all a JS expert but after getting silently upgraded to 8.2.0 I’m seeing the following error in my build:

TypeError: Cannot read property 'some' of undefined
    at Object.exports.install (/Users/mhughe008/development/vise/node_modules/whatwg-url/dist/URL.js:84:20)
    at exports.installInterfaces (/Users/mhughe008/development/vise/node_modules/jsdom/lib/jsdom/living/interfaces.js:202:24)
    at setupWindow (/Users/mhughe008/development/vise/node_modules/jsdom/lib/jsdom/browser/Window.js:63:3)
    at new Window (/Users/mhughe008/development/vise/node_modules/jsdom/lib/jsdom/browser/Window.js:107:3)
    at exports.createWindow (/Users/mhughe008/development/vise/node_modules/jsdom/lib/jsdom/browser/Window.js:38:10)

Failing at this section of code:

exports.install = (globalObject, globalNames) => {
  if (!globalNames.some(globalName => exposed.has(globalName))) {
    return;
  }
  class URL {
    constructor(url) {
      if (arguments.length < 1) {

This is using jsdom 16.1.2. Best I can tell this was probably caused by the upgrade to webidl-conversions:

-    "webidl-conversions": "^5.0.0"
+    "webidl-conversions": "^6.1.0"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
DanielVenturinicommented, Sep 2, 2020

whatwg-url@8.2.0 starts use the install method in dist/URL.js, as in this diff:

+exports.install = (globalObject, globalNames) => {
+  if (!globalNames.some(globalName => exposed.has(globalName))) {
+    return;
+  }

jsdom@<16.3.0 calls to install without the globalNames. jsdom@>=16.3.0 adds the globalNames when calls to whatwg-url, as in this diff:

// jsdom@16.3.0 lib/jsdom/living/interfaces.js
-exports.installInterfaces = window => {
+exports.installInterfaces = (window, globalNames) => {
   // Install generated interface.
   for (const generatedInterface of Object.values(generatedInterfaces)) {
-    generatedInterface.install(window);
+    generatedInterface.install(window, globalNames);
   }

For me, this error was fixed updating to jsdom@>=16.3.

1reaction
domeniccommented, Aug 25, 2020

Can you test using jsdom 16.4.0?

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebIDL Level 1 - W3C
This specification defines an IDL language similar to OMG IDL for use by specifications that define interfaces for Web APIs.
Read more >
Information contained in a WebIDL file - MDN Web Docs
This document provides a reference to help understand WebIDL syntax. IDL stands for Interface Definition Language and it is designed to describe ...
Read more >
@forbeslindesay/jsdom | Yarn - Package Manager
Due to a parse5 upgrade, the location info objects returned by dom.nodeLocation() or the old API's jsdom.nodeLocation() now have a different structure.
Read more >
Open Source Disclosures - SnapAttack
COMPONENT NAME VERSION LICENSE @amplitude/types 1.8.2 MIT @amplitude/ua‑parser‑js 0.7.24 MIT @amplitude/utils 1.8.2 MIT
Read more >
Relay
That means you won't accidentally break other components as you refactor or ... Relay's mutation API supports making optimistic updates to show immediate ......
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found