You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letserver;constdevServerConfig={};conststartServer=()=>{if(server){server.close();}// webpack plugin code, calls `startServer` on errorserver=newWebpackDevServer(compiler,devServerConfig);server.listen(8080);};startServer();
// Server.js, line 33. this is the thrown errorconstvalidationErrors=webpack.validateSchema(optionsSchema,options);if(validationErrors.length){thrownewOptionsValidationError(validationErrors);}
Expected Behavior
When I start a webpack-dev-server, it should validate the options passed through correctly.
When I start a new webpack-dev-server, it should validate the options passed through correctly.
Actual Behavior
When I start a webpack-dev-server for the first time, the devServerConfig is mutated with a bunch of extra fields populated by the dev server itself.
When I try to start a new webpack-dev-server, the config object does not pass validation on line 33 of Server.js because it mutated the config object.
For Bugs; How can we reproduce the behavior?
See the code snippets.
For Features; What is the motivation and/or use-case for the feature?
@dwjft as reporter you should provide all available info. thanks for the paste, we'll look into what's modifying that and see what we can put in place.
This is going to land in the beta branch in the next week or so, and has been implemented in the refactor-lib branch that is currently WIP. If someone steps up to fix this in the 2.9.x branch, we'll happily review a PR, but our energies right now are being directed towards getting 3.0.0@beta out the door.
Activity
shellscape commentedon Sep 28, 2017
@dwjft please provide the structure of your options before and after the first run, only then will we know what to look for specifically.
dwjft commentedon Sep 28, 2017
I mean, you can figure that out by just reading the snippet of code.
shellscape commentedon Sep 28, 2017
@dwjft as reporter you should provide all available info. thanks for the paste, we'll look into what's modifying that and see what we can put in place.
shellscape commentedon Oct 13, 2017
This is going to land in the
betabranch in the next week or so, and has been implemented in therefactor-libbranch that is currently WIP. If someone steps up to fix this in the 2.9.x branch, we'll happily review a PR, but our energies right now are being directed towards getting 3.0.0@beta out the door.