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
Exported class EXPRESSION reads .prototype as undefined from an importing module (class declarations are fine) #9366
export const Anon = class Named {} (named expression)
ok
undefined
So it is specifically a class expression, read across a module boundary. The same read inside the defining module is correct, and the class is otherwise fully functional through the importer — new Decl().m is a function, Object.getPrototypeOf(instance) is an object, instances work. It is the .prototype property access on the imported binding that answers undefined.
Not a regression: identical on 83754818e (#9242) and a03be729c (#9336).
Why this one matters
This is the shape at the heart of #9341. The diagnostic there shows cc --help dying on Object.defineProperty(undefined, "getContentType", …), and the undefined is z in axios:
kU6 is a class expression, which is exactly the shape above. A reduction of that accessor across two modules reproduces prototype=undefined on both the green and the broken build — so this bug is the machinery #9341's regression is landing on, even though the trigger for when the bundle takes this path is a separate change inside 83754818e..main.
Three other .prototype defects turned up in the same sweep, all pre-existing: #9365 (a statically-named o.prototype = v store silently dropped after a computed-key write), #9362 (util.inherits with a class ctor), #9364 (SIGSEGV on a chained class D extends <param> factory). Taken together, .prototype handling has several ordinary shapes that silently answer undefined, and silence is what makes them expensive: #9341 cost three wrong attributions and two unnecessary reverts before anyone saw the receiver.
Closely related prior art, both closed: #4933 (module.exports = class loses the class method table — static and prototype methods read undefined, via compilePackages) and #642 (drizzle: class identity lost through a barrel export *). Same family — a class value crossing a module boundary losing part of its class identity. Worth checking whether #4933's fix covers only the CJS module.exports = class form and not the ESM export let X = class form this issue uses, since the symptom is nearly identical.
Fixed by #9758, which landed on main via merge train #9798. The train was merged as its own branch, so the Fixes #9366 keyword in #9758 never fired — closing manually. Verified the fix is on main by patch-id (git cherry), not just by the PR being closed.
Activity
proggeramlug commentedon Sep 1, 2026
Closely related prior art, both closed: #4933 (
module.exports = classloses the class method table — static and prototype methods readundefined, via compilePackages) and #642 (drizzle: class identity lost through a barrelexport *). Same family — a class value crossing a module boundary losing part of its class identity. Worth checking whether #4933's fix covers only the CJSmodule.exports = classform and not the ESMexport let X = classform this issue uses, since the symptom is nearly identical.proggeramlug commentedon Sep 5, 2026
Fixed by #9758, which landed on
mainvia merge train #9798. The train was merged as its own branch, so theFixes #9366keyword in #9758 never fired — closing manually. Verified the fix is onmainby patch-id (git cherry), not just by the PR being closed.