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
On Perry 0.5.93, when a class is defined in module A and its method is called on an instance obtained in module B, the method body never executes. Perry returns a stub value of the declared return type. Same-file class method calls work correctly.
This is the final blocker for @perry/postgres: every conn.query(...) call on the driver's Connection instance returns an empty QueryResult stub instead of actually running the query. The class is defined in src/connection.ts, re-exported from src/index.ts, imported by user scripts — that import boundary is enough to trigger this.
Moving Thing and makeThing into the same file as main() makes the method body execute correctly. The bug is specifically about the import boundary.
Likely connected to
typeof obj.method returning 'undefined' even when the method is callable — probably the same method-lookup path misses on imported classes (unrelated but-also-broken symptom: on a same-file class, typeof obj.method returns 'undefined' but the call still works).
Every TS library that exports a class with methods and expects consumers to import it is currently non-functional on Perry. This includes @perry/postgres (blocks all queries).
Summary
On Perry 0.5.93, when a class is defined in module A and its method is called on an instance obtained in module B, the method body never executes. Perry returns a stub value of the declared return type. Same-file class method calls work correctly.
This is the final blocker for
@perry/postgres: everyconn.query(...)call on the driver'sConnectioninstance returns an emptyQueryResultstub instead of actually running the query. The class is defined insrc/connection.ts, re-exported fromsrc/index.ts, imported by user scripts — that import boundary is enough to trigger this.Repro
lib.ts:
main.ts:
Observed on Perry 0.5.93
[Thing.doWork] enteredis never logged — the method body never ran.ris[object Object]— Perry returned a raw stub object instead ofawait-ing the Promise chain to a string.Expected (Bun / Node output)
Same-file case works fine
Moving
ThingandmakeThinginto the same file asmain()makes the method body execute correctly. The bug is specifically about the import boundary.Likely connected to
typeof obj.methodreturning'undefined'even when the method is callable — probably the same method-lookup path misses on imported classes (unrelated but-also-broken symptom: on a same-file class,typeof obj.methodreturns'undefined'but the call still works).QueryResult(all fields undefined).Impact
Every TS library that exports a class with methods and expects consumers to import it is currently non-functional on Perry. This includes
@perry/postgres(blocks all queries).Environment
perry run main.ts