brocoders / nestjs-boilerplate

NestJS boilerplate. Auth, TypeORM, Mongoose, Postgres, MongoDB, Mailing, I18N, Docker.
https://nestjs-boilerplate-test.herokuapp.com/docs
MIT License
3k stars 606 forks source link

HMR (Hot-Module Replacement) error: Cannot use import statement outside a module #1218

Open block2k opened 11 months ago

block2k commented 11 months ago

I cloned your project, then set up HRM following the instructions of nestjs docs https://docs.nestjs.com/recipes/hot-reload

then I run the command: nest build --webpack --webpackPath webpack-hmr.config.js --watch and receive the error as shown in the image:

Cannot use import statement outside a module

image

I tried running npm run start:dev and the project still started up without errors

block2k commented 10 months ago

@Shchepotin Do you have any way to fix this error?

Shchepotin commented 10 months ago

@block2k Sorry but no, because TypeORM has a problem with their config in HMR mode.