You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mongodb-connection-string-url: 'get protocol' called on an object that is not a valid instance of URL (regression on main, blocks mongodb connect) #11139
On current main, constructing a mongodb-connection-string-urlConnectionString throws whatwg-url's brand-check error. That makes new MongoClient(uri) fail before any socket I/O, so mongodb 7.5.0 can no longer connect. This is a regression: on d8f24f1 the same fixture, with #11113 (#11043) and #11130 (#11111/#11106) applied, connected and completed ping. It now fails at startup, with or without #11113 applied.
direct mongodb:
subclass mongodb:
ConnectionString mongodb:
Perry main784ed8e (v0.5.1649) + #11130, perry-dev, Linux x64:
direct mongodb:
subclass mongodb:
ConnectionString THROWS 'get protocol' called on an object that is not a valid instance of URL.
The error text comes from whatwg-url's generated URL.js wrapper (exports.is(esValue) fails). The ConnectionString instance is not seen as a URL wrapper, so the object that super(...) returned presumably lost its implSymbol own property, or its prototype link.
What does not reproduce it
All of these pass on the same build, written as user TypeScript against the compiled whatwg-url:
plain URL
class Sub extends URL {}
class Sub2 extends Sub { constructor(u) { super(u) } }
ConnectionString's two distinctive traits, alone and together: a class field _hosts;, and super(...) called inside try { … } catch
So the trigger appears to need the package's own compiled-JS class, inside its CommonJS module wrapper: class URLWithoutHost extends whatwg_url_1.URL {} and then class ConnectionString extends URLWithoutHost { _hosts; constructor(uri, options = {}) { …; try { super(…) } catch (err) { … } } } (lib/index.js, lines 73–130).
Range
Good: d8f24f1 + #11105 + #11113 + #11130; the fixture connected and ran ping. Bad: 784ed8e (merge trains 264–266). Not bisected.
Activity
fix(hir): a member heritage named like a JS built-in is not that buil…
test(gap): vendor the whatwg-url / mongodb-connection-string-url heri…
test(hir): #11139 unit test uses an ESM namespace import and a distin…