Webpack TypeScript module.hot does not exist Webpack TypeScript module.hot does not exist typescript typescript

Webpack TypeScript module.hot does not exist


As few guys wrote here it's the best way:

npm i -D @types/webpack-env

For me it works as expected, resolving issue with not recognized hot property.

In my project I'm using those versions:

"@types/node": "^8.0.19","@types/webpack-env": "^1.13.0"

I don't know if question is still up to date but for my problem installing types for webpack help me.


Conflict resolution

@types/webpack-env was since updated:

The code in the original question now only needs @types/webpack-env.

But importing @types/node alongside won't conflict anymore.


Installation

npm install --save-dev @types/webpack-env

And if you also need NodeJS environment definitions:

npm install --save-dev @types/node


Could be as simple as adding following line at the top of the file.

///<reference types="webpack-env" />