-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InjectModel brake on mongoose 5.12.9 and higher #424
Comments
Hello, could you solve it? I have the same error |
I did not found a solution, so I have to stay with |
I had a similar problem, and my mistake was a combination of various bad dependencies. |
Hi, i have a similar problem on a very simple training project. I've been stucked on this for hours now....
|
@GuillaumeGSO You did the same mistake as I did: @Module({
imports: [
TypegooseModule.forRoot(config.mongoURI), CompanyDataModule, NotificationsModule],
controllers: [
AppController, // Should be there since it is AppModule's responsibility to instantiate this.
NotificationsController // Should NOT be here since it is NOT AppModule's responsibility to instantiate this.
],
providers: [
AppService,// Should be there since it is AppModule's responsibility to instantiate this.
CompanyDataService, // Should NOT be here since it is NOT AppModule's responsibility to instantiate this. However since this one doesnt have any deps, it doesnt crash. It will be instantiated twice though.
NotificationService, // Should NOT be here since it is NOT AppModule's responsibility to instantiate this.
NotificationDataService // Should NOT be here since it is NOT AppModule's responsibility to instantiate this.
],
})
export class AppModule {} Including services and controllers into the Remove the commented lines above, and your code will run. |
Thank you so much ! |
Hi, I'm testing latest
typegoose@beta.11
withmongoose 5.12.9
(tested also with5.12.10
and5.12.12
) but theInjectModel
got breaked.I have tried several combination of typegoose and mongoose and I can say that the maximum supported versions are
typegoose beta.9
andmongoose 5.12.8
. InjectModel stop working from mongoose5.12.9
and higher.To be noted that from typegoose
beta.10
the minimum supported version of mongoose is5.12.9
so I can't upgrade typegoose too.Thanks in advance
The text was updated successfully, but these errors were encountered: