Webpack webpack.config.js reports an error, but webpack is normal.

compiled using webpack4, but localhost access reported an error

Server express,webpack4.26,babel correlation is above 7. React16.6

webpack4react

Can"t resolve "fs" in
webpack.confignode {fs : "empty"};localhostindexgracefule.js63Cannot read property "toString" of undefined

according to the source code, this should be a module of node, and it should not be packaged into js.
after that, I packaged directly with npm run or webpack, without webpack webpack.config.js,.

I would like to know why. At present, the direction under consideration is path-related reasons. But I don"t have a clue

Dec.05,2021
What is the script for

npm run? This error is probably caused by the order in which HtmlWebpackPlugin adds each chunk. Try changing the order of each chunk by modifying the chunksSortMode configuration item; put the chunk in front of it

Menu