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
Next.js's bundled zod (next/dist/compiled/zod/index.cjs) breaks under perry in several related ways; the smallest repro is a one-liner. This is the current gscmaster/Next.js standalone boot blocker (layer 3, behind #6522 and #6523/#6527 which are now merged): next/dist/server/config-schema.js init dies with TypeError: Cannot read properties of undefined (reading 'description').
Repros (driver requires a local copy of next/dist/compiled/zod/index.cjs)
constz=require("./zod-index.cjs").z;// 1. SMALLEST: parse an optional with undefined inputz.string().optional().parse(undefined);// perry: TypeError: Cannot read properties of undefined (reading 'errorMap')// node: returns undefined// 2. record with an object value type containing an .optional() fieldz.record(z.string(),z.object({p: z.string(),q: z.boolean().optional()})).parse({a: {p: "x"}});// perry: TypeError: Cannot read properties of undefined (reading '_getType')// node: { a: { p: "x" }}// 3. subclass identity collapses to the base classz.string().constructor.name// perry: "ZodType" node: "ZodString"z.object({}).constructor.name// perry: "ZodType" node: "ZodObject"
Notably z.record(z.string(), z.boolean()).parse(...), z.object({p:z.string()}).parse(...), and z.array(z.any()).optional() (creation only) all work — the failures need the optional-parse path / richer schemas.
Boot-time manifestation (gscmaster / any Next 16 standalone app)
next/dist/server/config-schema.js init → ZodRecord.create → a field-by-name read walks the proto chain into ZodType's get description() with a receiver whose _def is undefined → uncaught TypeError → server dies before Ready. lldb stack (debug-symbol build, b js_throw_type_error_property_access):
The subclass-identity collapse (repro 3) suggests the bundled zod's class-hierarchy shape (class ZodString extends ZodType + statics assigned after the class + namespace/getter exports) constructs instances with base-class identity — the "native-base subclassing / subclass statics" family (#6232, myairank walls). The get description proto-chain hit with a foreign/incomplete receiver and the errorMap/_getType undefined reads look like downstream symptoms of instances missing their subclass construction.
Activity
fix(runtime): capture-carrying class statics + class-object value-sup…
fix(runtime,codegen): capture-class construction args, statics mirror…
chore: size-gate splits for files grown past 2000 lines
fix(runtime,codegen): bundled-zod capture-class family — statics disp…
refactor(codegen): explicit HIR marker for appended class-capture for…
fix(runtime): exclude class objects from the store-plan cache (#6595) (…
fix(runtime): a class used as a value is its function object; statics…
feat(runtime): class static accessors are accessor properties of the …