-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatibility with recent versions of inversifyJS #1717
Comments
Hello there helios-ag 👋 Thank you for opening your very first issue in this project. We will try to get back to you as soon as we can.👀 |
Closed
4 tasks
Hello, I have used another workaround. Cast is a bad practice, but it makes the deal for a temporary fix : const createIocContainer = (): IocContainer & Container => {
const iocContainer = new Container({ autoBindInjectable: true, defaultScope: 'Singleton' });
iocContainer.load(buildProviderModule());
return iocContainer as IocContainer & Container;
}; |
@VincentClair thanks for sharing, but any current solution will require kind of typecast |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
If you define container configuration according to current docs
Container expected to be compiled
Current Behavior
If you define container configuration according to current docs
and point to it in the tsoa.json as iocModule
And during build we getting error
Possible Solution
This happens due to recent changes in the InversifyJS
Signature of
export type ServiceIdentifier<T = unknown> = (string | symbol | Newable<T> | Abstract<T>);
has been changed to
https://github.com/inversify/InversifyJS/blob/master/src/interfaces/interfaces.ts#L66
that borrowed from here:
https://github.com/inversify/monorepo/blob/main/packages/container/libraries/common/src/services/models/ServiceIdentifier.ts#L3C8-L8C14
The simplest solution without doing changes to libraries itself to make wrapper, in TSyringe way:
Now you need to wrap it up:
And point to it in tsoa.json
Another way to fix behavior is to update signature of container definition here
https://github.com/lukeautry/tsoa/blob/master/packages/runtime/src/interfaces/iocModule.ts#L2
Context (Environment)
Version of the library: 6.5.0
Version of NodeJS: 22.11
Detailed Description
Breaking change?
The text was updated successfully, but these errors were encountered: