MongooseCoreModule cannot be exported
See original GitHub issueI’m submitting a…
[ ] 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.
Current behavior
When bootstrapping the Application and importing the Mongoose module, the application crashes with following message:
Nest cannot export component / module that is not a part of the currently proccessed module (MongooseCoreModule). Please verify whether each exported unit is available in this particular context.
Expected behavior
Mongoose module should get imported without errors
Minimal reproduction of the problem with instructions
@Module({
imports: [
MongooseModule.forRoot(/* some connection url*/)
]
})
export class ApplicationModule {
}
What is the motivation / use case for changing the behavior?
We use NestJS on our production servers, so for obvious reasons.
Environment
{
"@nestjs/core": "^4.5.10",
"@nestjs/microservices": "^4.5.8",
"@nestjs/mongoose": "^3.0.1",
"@nestjs/testing": "^4.5.5",
"@nestjs/typeorm": "^2.0.0",
"@nestjs/websockets": "^4.5.8",
"@types/mongoose": "^5.0.13",
"mongoose": "^5.0.17"
}
Nest version: 4.5.x
For Tooling issues:
- Node version: 8
- Platform: Docker running Linux (Ubuntu 16.04)
Others:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Nest can't resolve dependencies of the ... - Stack Overflow
Nest can't resolve dependencies of the MongooseCoreModule (MongooseConnectionName, ?). Please make sure that the argument ModuleRef at index ...
Read more >Module reference | NestJS - A progressive Node.js framework
Hint The ModuleRef class is imported from the @nestjs/core package. Retrieving instances#. The ModuleRef instance (hereafter we'll refer to it ...
Read more >NestJS: Resolving Dependency Injection - Tevpro
If dependency is exported from a separate @Module, is that module imported within AuthModule? @Module({ imports: [ /* the Module containing dependency */...
Read more >NestJS + Typegoose | tnc - nartc.netlify.com
Create an abstract class so it cannot be initialized ( new() up ) ... shared/base.model'; export class Product extends BaseModel { @prop() ...
Read more >Module '"mongoose"' has no exported member ... - YouTube
In this video, we fix an error related to DocumentDefinition and update service inputs so they do not need to omit values.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This happened to me and I also noticed that the InjectModel signature had a breaking change between version 3.0.1 and 3.0.2 which should not be the case if this is following semver.
In version 3.0.1 you can pass a schema but in 3.0.2 you have to pass a string.
For those who face this issue as well - please, lock your version with
3.0.1
if your app uses Nest@4. Now, all packages follow the same semantic versioning (@nestjs/mongoose@5.0.0
matches Nest@5)