also ts+react webpack is configured with HotModuleReplacementPlugin ()\,
Why do I module.hot error: TS2339: Property "hot" does not exist on type" NodeModule".
webpack.config.js
new webpack.HotModuleReplacementPlugin(),
demo.ts
if(module.hot) {
{
// ...
}
TS2339: Property "hot" does not exist on type" NodeModule".
resolved
solution:
1. if (module as any).hot {}
2. yarn add @types/webpack.env -D