Also ts+react 'hot' does not exist on type' NodeModule'

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".

clipboard.png

resolved

solution:

1. if (module as any).hot {}

2. yarn add @types/webpack.env -D
If

is normal, you can ignore


by configuring the types file or writing the condition directly.

without looking at the detailed code, you can't see what's wrong. The easiest way is to use webpack-dev-server instead.

and take a look at your error prompt error, there is a code error in your source file. Your picture is incomplete. There should be a message on the right.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be581d-3176f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be581d-3176f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?