79104841

Date: 2024-10-19 11:54:52
Score: 1
Natty:
Report link

My genuine answer to this is

Dot use Typeorm with NextJS

I also faced a lot of problems in setting up typeorm in NextJS. The thing is i somehow configured typeorm in my project, and it was working absolutely fine. But what happens is NextJS bundles the code in production build in very weired way. it dosent has teh same file structure as your source code. It is actually a good thing cause it helps in minification. But somehow typeorm relies on the folder structure of your project.

So what happens is you project wil work in development mode but it will fail in the production build.

So yeah, dont use TypeORM with NextJS. Use Prisma... ;-)

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Shahil Sharma