Skip to content

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

@block2k

Description

@block2k

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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions