[ ] 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.
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.
Mongoose module should get imported without errors
@Module({
imports: [
MongooseModule.forRoot(/* some connection url*/)
]
})
export class ApplicationModule {
}
We use NestJS on our production servers, so for obvious reasons.
{
"@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:
Thanks @MichaelCastiau, I'll take a look
@kamilmysliwiec I noticed the feature was broken as of @nestjs/mongoose 3.0.2. We temporarely locked the package to 3.0.1.
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.
Same here, I've lost some time debugging before I found this issue. Thanks for finding out what's the problem @MichaelCastiau @cesarp :+1:
Thanks for reporting @cesarp. It's my mistake, seems that 3.0.2 was accidentally published as a patch version 馃槥 Inconsistency between main framework version and the additional modules make it really difficult to manage them correctly. In the near future, I'm going to bump all packages to follow the same semantic versioning, thereby modules like @nestjs/[email protected] will match v5 and so on.
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/[email protected] matches Nest@5)
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.
Most helpful comment
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.