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
perry-codegen: classes from compilePackages have no instance methods/fields #482
Reproduces with both .js and .ts source in node_modules.
Reproduces with `class Foo {}` declaration AND `var Foo = class {}` expression assignment.
The same class definition in a project-local `.ts` file (not in compilePackages) works correctly.
`new Foo()` succeeds (returns an object), but the resulting instance has neither own properties (`name`) nor prototype methods (`add`).
Why it matters
Blocks #421 (hono) at the deeper dispatch level. Hono's `RegExpRouter`'s `add()` / `buildAllMatchers()` methods are unreachable, so route registration silently no-ops and `app.fetch()` returns a default 404-shape Response. Likely also blocks #420 (drizzle) at any point where drizzle's class instances are constructed and methods invoked.
Likely root cause
Perry-codegen's per-class method registration (`perry_method_`) and dispatch (`HANDLE_METHOD_DISPATCH` / `js_register_class_method`) needs to fire for classes whose source module was discovered via the `compilePackages` resolver. Most stdlib + project-local class registration paths run during `compile_module_entry`, but the cross-package import resolver might short-circuit some of the wiring.
Workaround
None at user level. Only fix is to land in perry-codegen.
Activity
fix(hir): closes #588 — `export { foo }` separately for function decl…
fix(hir,compile): complete #665 default-imported-class fix (v0.5.800)