Issues running Mikro-ORM with NestJS on Vercel platform #178
Unanswered
emulienfou
asked this question in
Q&A
Replies: 2 comments
-
those problems are usually not about the place where you deploy to, but about dev vs production builds. have you tried to build your app for production and run it locally? i'd guess it will break the same |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm getting the same error when using nest build --webpack and running the bundled .js |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
Trying to run a simple NestJS application with Mikro-ORM on Vercel platform.
Stack trace
Neither
EntityManager
norEntityRepository
seems to be available as service when injecting into a Service class.Tried with:
constructor(@InjectRepository(Author) private readonly authorRepository: EntityRepository<Author>){}
:Also tried with
constructor(em: EntityManager) {}
To Reproduce
Reproductible repository is available here: https://github.com/emulienfou/template-nestjs-vercel
Expected behavior
NestJs should be able to load dependency EntityManager from driver.
This is currently not the case.
Injecting from
import { EntityManager } from "@mikro-orm/core";
seems to resolve the issue temporarily.However, due to injecting from
@mikro-orm/core
I need to do something like this:Preview
https://template-nestjs-vercel-git-preview-beat-platform.vercel.app
Versions
Beta Was this translation helpful? Give feedback.
All reactions