-
-
Notifications
You must be signed in to change notification settings - Fork 718
postConstruct isn't called on abstract base class #1905
Copy link
Copy link
Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
I've method mark with postConstruct on a base class which doesn't get called
Steps to reproduce
@injectable()
export abstract class BaseService {
@postConstruct()
protected async [Symbol('_construct')](): Promise<void> {
// never called
console.log("construct");
await Promise.resolve();
}
}
@injectable()
@injectFromHierarchy()
class RealService extends BaseService {
// some more code
}
const c = new Container({autobind:true));
await c.getAsync(RealService); // should log `construct`Expected behavior
it should call decorated method
Possible solution
No response
Package version
7.9.1
Node.js version
v22.19.0
In which operating systems have you tested?
- macOS
- Windows
- Linux
Stack trace
No response
Other
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels