200 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
2
answers
91
views
How to add body-parser to Inversify's Express Adapter?
I can't figure out how to add body-parser to Inversify's new built-in express adapter. I currently have a very simple setup (basically right from the docs):
import { Container } from 'inversify';
...
0
votes
1
answer
85
views
How can I add API common prefix for controllers
I want to add an API common prefix for all controllers, e.g. /api/v1. I am using inversify with the @inversify/http-express package.
Here is my current base server adapter setup:
class Server {
...
1
vote
2
answers
53
views
How can I create Not Found API route in "@inversifyjs/http-express"
I explored and tried to build my next API project with "@inversifyjs/http-express". Now I'm struggling to create a Not Found API route because I can't find any docs on it.
For now, I add ...
1
vote
2
answers
57
views
Overwrite previously-injected services in Singletons
I'm trying to use inversify with sinon to help with testing, and inversify isn't behaving as I was expecting. Basically, I have producer and consumer singletons, and I want to change the data that the ...
0
votes
1
answer
63
views
Difference in binding a factory returning a promise and a provider
I'm working with InversifyJS and I'm confused about when to use toFactory() and return a promise vs. toProvider(). The documentation doesn't clearly explain the behavioral differences.
In my codebase, ...
0
votes
0
answers
49
views
How to pass controller class instance to Fastify routing?
I'm trying to pass an instance of a controller class to Fastify routing, but Fastify only calls the method "login", the constructor is not called
const userController = container.get<...
0
votes
0
answers
60
views
After updating inversify from version 6 to 7.5, my tests are failing
Container fails to bind in few cases (we have a lot of similar tests which are working).
●くろまる Test suite failed to run
TypeError
37 | container.bind<IFracStore>(FracStoreType).to(...
0
votes
1
answer
125
views
Does Inversify actually require emitDecoratorMetadata for Typescript?
Inversify README claims that it requires "emitDecoratorMetadata": true in your tsconfig.json to be used with Typescript. But I am able to set it to false and my app runs just fine with ...
1
vote
0
answers
107
views
TS1239: Unable to resolve signature of parameter decorator when called as an expression when using inversify and custom lazyLoading function
Have created the custom lazyLoading function in utils.ts that makes lazyServiceidentifier of inversify , when I try to consume the lazyLoading function in one the other service file within same ...
0
votes
1
answer
294
views
I want to use express route in typescript inversify and express
I want to use custom express route in inversify with express+typescript
So code is below:
App.ts
import 'reflect-metadata';
import { InversifyExpressServer } from 'inversify-express-utils';
import { ...
3
votes
1
answer
3k
views
vite: pre-transform error: Expression expected after inversify's @injectable
I'm trying to integrate inversify.js 6.0.2 with a Vite 5.2.0, React 18.2.0, Typescript 5.2.2 project. I followed the steps outlined in the readme file of the project github repository, but ended up ...
-1
votes
1
answer
448
views
How can I inject the prisma io module using inversify in my node.js project?
As mentioned in the title, I am trying to do dependency injection operations with a node.js project, but I don't know how to use the inversify module with prisma.
I did a lot of research on the ...
1
vote
1
answer
422
views
How to avoid the service locator pattern when using inversify in React Native?
I'm trying to use InversifyJS in a react native application that uses a functional approach to components. I have everything configured and working as it should, however, the only way in which I can ...
0
votes
1
answer
313
views
Inversify child class with super method passing the argument to parent is not working
When I try to pass the argument to parent class via super class in inversify there is argument error :
"message": "The number of constructor arguments in the derived
class Child must ...
0
votes
1
answer
77
views
Inverisfy express util is not connecting to web socket socket.io server
import 'module-alias/register';
import 'reflect-metadata';
import sourceMapSupport from 'source-map-support';
import { LIB_ENV_CONFIG, logger } from '@sn/shared';
import { AppServer, ...