DEV Community

Discussion on: Nx NestJs - Typeorm database connection with environment variables

 
artifex profile image
Artifex

There must be something wrong with webpack i tried your approach it wont detect entities on runtime thats just sad, i just made another class to do my migrations i use this approach on runtime i use your previous service inject approach, but i manually override entity locations. Thank you!

Thread Thread
 
ipreda profile image
Iulian Preda

Yes. Webpack packs everything together in a single bundle and i suppose the paths are ruined in that case.
For that Nest has the "autoLoadEntories" option vut you need to import every entity in the ORM's module for it to work.