-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
DI failing to find Mikro-Orm repositories after upgrading to NestJs v8 #32
Comments
support for nest v8 was added in v4.3, you are using v4.2 so first try to upgrade to latest, it should be already fixed there |
This helped resolve quite a few of the DI failures though unfortunately not all of them. Thanks very much ! |
So I am still running into the same issue as I have resented except but with different repositories. I have update the mikro-orm/nest package as suggested. The issue has been replicated and can be found in the link in the above issue. I have also adjusted the issue's stack trace and versions to reflect the changes. |
This is actually not really about MikroORM, the issue here is that your custom repositories for some entities are not even registered, like the one for I will probably remove that decorator in v5, it only adds weird issues like this. It can work only if you ensure the file will get required soon enough. So to resolve this, drop your |
Describe the bug
Dependency injection errors are thrown as a result of Nest not being able to find an entity's repository. Repositories are all imported in a single module (database.module.ts) using the forFeature() function.
Stack trace
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Additional context
can get rid of this particular error by putting MikroOrmModule.forFeature([Profanity]) in the imports section of profanity.module.ts file; except this is not a good solution as the errors continue onto the next repository until I come across a repository that is used across multiple services all provided in different modules.
Versions
Node version: 14.17.5
Platform: Linux
The text was updated successfully, but these errors were encountered: