webpack HMR (Hot-Module Replacement) in nestjs error: Cannot use import statement outside a module

75 views Asked by At

I cloned this project from Github: https://github.com/brocoders/nestjs-boilerplate

Then I set up webpack HMR (Hot-Module Replacement) according to instructions from nestjs documentation: https://docs.nestjs.com/recipes/hot-reload

Then I ran the command nest build --webpack --webpackPath webpack-hmr.config.js --watch and got the error as shown in the image: SyntaxError: Cannot use import statement outside a module

enter image description here

I have tried searching and trying every tutorial on google but it doesn't work, please help me.

0

There are 0 answers