-
-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
- Webpack Version: 5.38.1
- Operating System (or Browser): Windows 10, Firefox 95.0.2
- Node Version: v14.15.5
- webpack-plugin-serve Version: 1.5.0
How Do We Reproduce?
- Build a project in dev and watch mode
> webpack --mode development
- Open served page in the browser and refresh it (F5) al least one time
- Change something in the source code to trigger HMR
Expected Behavior
Rebuild should be done successfully without errors and warnings
Actual Behavior
Rebuild is done. Everything works. But this this warning is shown in the terminal of Webpack process
WARNING in DefinePlugin
Conflicting values for 'ʎɐɹɔosǝʌɹǝs'
'{"compress":null,"headers":null,"historyFallback":{},"hmr":"refresh-on-failure","host":"localhost","liveReload":false,"log":{"lev"minimal","ramdisk":false,"secure":false,"status":true,"client":{"silent":true,"retry":true},"waitForBuild":true,"address":"localhost:3000","compilerName":null,"wpsId":"fb5dfed"}' !== '{"compress":null,"headers":null,"historyFallback":{"htmlAcceptHeaders":["text/html","*/*"],"rewrites":[]},"hmr":"refresh-on-failure","host":"localhost","liveReload":false,"log":{"level":"info","timestamp":false,"prefix":{"template":"{{level}}"},"name":"webpack-plugin-serve"},"open":false,"port":3000,"progress":"minimal","ramdisk":false,"secure":false,"status":true,"client":{"silent":true,"retry":true},"waitForBuild":true,"address":"localhost:3000","compilerName":null,"wpsId":"fb5dfed"}'
And it is multiplied every time rebuild is triggered. So the terminal becomes higly polluted at some moment.
This happens because ʎɐɹɔosǝʌɹǝs
is changed between rebuilds. The only difference is this part "historyFallback":{"htmlAcceptHeaders":["text/html","*/*"],"rewrites":[]}
. I found that this object is mutated when it is passed to the 3rd party middleware on this line
webpack-plugin-serve/lib/middleware.js
Line 123 in ba83bf5
app.use(convert(historyApiFallback(options.historyFallback))); |
app.use(convert(historyApiFallback({ ...options.historyFallback})));
Metadata
Metadata
Assignees
Labels
No labels