Skip to content

2.11.4 Fix injectable scanning on Deno 2.9

Latest

Choose a tag to compare

@Sorikairox Sorikairox released this 16 Aug 14:12
· 2 commits to main since this release

Fixes

ScheduleModule, KvQueueModule and EventEmitterModule each scan every own property name of an injectable's constructor.prototype and hand the value to MetadataHelper.getMetadata, which throws a TypeError on a non-object target.

A plain-value injectable declared as { token, useValue: { ... } } passes the IsObject guard and has Object.prototype as its constructor.prototype, so the scan walks that object's own property names. Deno 2.9 added __proto__ to Object.getOwnPropertyNames(Object.prototype), and reading it back yields a non-object — so app.init() threw for any application combining one of these modules with an object useValue.

Only methods can carry the metadata, so non-function properties are now skipped.

EventEmitterModule additionally lacked the IsObject guard its two sibling modules already had, which meant a primitive or undefined useValue crashed it on .constructor.prototype. That guard is now in place too.

If you are on Deno 2.9 or newer and hit TypeError from Reflect.getMetadata during app.init(), this release fixes it.

Packaging

graphify-out/, .claude/ and openspec/ are excluded from deno publish, so the package no longer ships local tooling directories.