I don't know if it's a bug, or some info lacking in documentation
[ ] Regression
[x ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
I'm building an application with Nest using MongoDB. I followed the documentation guide, but all I get is "Nest can't resolve dependencies of XModel"
Should just run as the guide says
Repo: https://github.com/DavideCarvalho/pharmacy_back on branch feature/add-mongo
I tried with Node 11.14 and Node 8
Mongo 3
Fedora
Nest version: 6.1.0
Update your @nestjs/mongoose to 6.1.2 - @nestjs/[email protected]
I am having the same issue with Nest6.1, when I use;
import {Model} from 'mongoose', I get the Nest cant resolve dependencies error, which goes away if I remove the use of mongoose.
Have updated @nestjs to [email protected], but this has no effect
Same here. The model dependencies are not being resolved despite the fact that I have upgraded Jest.
Hello,
unfortunately I am getting the same error, but I can not figure out why. I think everything is properly configured. I can not inject the model though.
Error: Nest can't resolve dependencies of the GuitarsService (?). Please make sure that the argument at index [0] is available in the AppModule context.
at Injector.lookupComponentInExports (/Users/jmpo/dev/Projects/nest_api/node_modules/@nestjs/core/injector/injector.js:183:19)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
hello,
when I add
constructor(private readonly catsService: CatsService) {}
to cats.controller.ts
I got the error in command
Nest can't resolve dependencies of the CatsController (?). Please make sure that the argument at index [0] is available in the AppModule context. +1ms
Error: Nest can't resolve dependencies of the CatsController (?). Please make sure that the argument at index [0] is available in the AppModule context.
at Injector.lookupComponentInExports (/Users/jj/Desktop/projects/nest-example/node_modules/@nestjs/core/injector/injector.js:183:19)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
code from doc
Hi Boxshadow,
at the end I fixed my error, I was importing my controller in several modules at the time. My bad. After checking your error, it might be the same. Also it might be that catsService is not properly annotated with the @Injectable or defined (exported/imported) in the proper module ...
@JoSeTe4ever u r rigth, thx
Had the same issue and in my case I provided catsService in AppModule and also in CatsModule.
Removing catsService from AppModule providers resolved the issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.