[英]Nest can't resolve dependencies of the RegisterService (?).Please make sure that the argument at index [0] is available in the RegisterModule context
I am facing this problem in nestjs.Project structure is like-我在 nestjs 中面临这个问题。项目结构就像-
src-
-RegisterModule
-register.controller.ts
-register.service.ts
-register.dto.ts
-register.schema.ts
-register.module.ts
-app.module.ts
-app.controller.ts
-app.service.ts
Yaa....I got the solution in just 2 simple steps Yaa....我只用两个简单的步骤就得到了解决方案
MongooseModule.forFeature([{ name: 'Register', schema: registrationSchema }])
in registerModule's import section在 registerModule 的导入部分导入MongooseModule.forFeature([{ name: 'Register', schema: registrationSchema }])
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.