I updated whole my project's dependencies today, and i got a few collisions.
Other things got issues open already but i cannot find this one.
As webpack-node-externals version is updated 1.7.2 to 2.3.0 in two years, it has breaking change in options.
As it is only for who had updated it, I cannot rashly make PR from it
We should change our option property whitelist to allowlist
v1 : https://www.npmjs.com/package/webpack-node-externals/v/1.7.2
v2 : https://www.npmjs.com/package/webpack-node-externals
As is
externals: [
nodeExternals({
whitelist: ['webpack/hot/poll?100'],
}),
],
To be
externals: [
nodeExternals({
allowlist: ['webpack/hot/poll?100'],
}),
],
if you do not change above part, you will got error as follows
Error: [HMR] Hot Module Replacement is disabled.
at Object../node_modules/webpack/hot/poll.js?100 (C:\Users\82106\Desktop\vhract\dist\webpack:\(webpack)\hot\poll.js:36:1)
at __webpack_require__ (C:\Users\82106\Desktop\vhract\dist\webpack:\webpack\bootstrap:19:1)
at Object.0 (C:\Users\82106\Desktop\vhract\dist\main.js:13006:1)
at __webpack_require__ (C:\Users\82106\Desktop\vhract\dist\webpack:\webpack\bootstrap:19:1)
at C:\Users\82106\Desktop\vhract\dist\webpack:\webpack\bootstrap:83:1
at Object.<anonymous> (C:\Users\82106\Desktop\vhract\dist\main.js:88:10)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
I do not know it is relevant but I experienced another issue
follows is my build nest app command webpack --config webpack.config.js
it does not have any problems before, but it cause as follows
Error: [HMR] Hot Module Replacement is disabled.
at Object../node_modules/webpack/hot/poll.js?100 (C:\Users\82106\Desktop\vhract\dist\webpack:\(webpack)\hot\poll.js:36:1)
at __webpack_require__ (C:\Users\82106\Desktop\vhract\dist\webpack:\webpack\bootstrap:19:1)
at Object.0 (C:\Users\82106\Desktop\vhract\dist\main.js:13006:1)
at __webpack_require__ (C:\Users\82106\Desktop\vhract\dist\webpack:\webpack\bootstrap:19:1)
at C:\Users\82106\Desktop\vhract\dist\webpack:\webpack\bootstrap:83:1
at Object.<anonymous> (C:\Users\82106\Desktop\vhract\dist\main.js:88:10)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
And I solved by adding --hot arg to my build command
webpack --config webpack.config.js --hot
and removed
new webpack.HotModuleReplacementPlugin() from webpack.config.js
For Tooling issues:
Would you like to create a PR for this issue?
Can you update this file https://github.com/nestjs/nest/blob/master/sample/08-webpack/webpack-hmr.config.js as well? :)
Most helpful comment
Can you update this file https://github.com/nestjs/nest/blob/master/sample/08-webpack/webpack-hmr.config.js as well? :)