Skip to content

Commit 2bf4577

Browse files
bugfix(core): injecting dependencies into middleware error nestjs#1834
1 parent ca62dc9 commit 2bf4577

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

packages/core/injector/injector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class Injector {
8181
const loadInstance = (instances: any[]) => {
8282
targetWrapper.instance = targetWrapper.isDependencyTreeStatic()
8383
? new metatype(...instances)
84-
: Object.create(metatype);
84+
: Object.create(metatype.prototype);
8585
};
8686
await this.resolveConstructorParams(
8787
wrapper,

packages/core/middleware/container.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export class MiddlewareContainer {
3030
new InstanceWrapper({
3131
scope: this.getClassScope(metatype),
3232
metatype,
33+
name: token,
3334
}),
3435
);
3536
};

0 commit comments

Comments
 (0)