Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack-dev-server seems to require the dev-middleware config #6329

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

justinclift
Copy link
Member

What type of PR is this?

  • Bug Fix

Description

This PR updates the configuration for webpack-dev-server, to avoid a fatal error when trying to start it:

$ yarn webpack-dev-server
yarn run v1.22.19
$ webpack-dev-server
[webpack-cli] Invalid options object. Dev Server has been initialized using an options object that does not
match the API schema.
 - options has an unknown property 'stats'. These properties are valid:
   object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?,
hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?,
onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?,
webSocketServer? }
error Command failed with exit code 2.

How is this tested?

  • Manually

With the updated configuration in this PR, webpack-dev-server works again:

$ yarn webpack-dev-server
yarn run v1.22.19
$ webpack-dev-server
<i> [webpack-dev-server] [HPM] Proxy created: /login,/logout,/invite,/setup,/status.json,/api,/oauth  -> http://localhost:5001/
<i> [webpack-dev-server] [HPM] Proxy created: path => {
<i>           // CSS/JS for server-rendered pages should be served from backend
<i>           return /^\/static\/[a-z]+\.[0-9a-fA-F]+\.(css|js)$/.test(path);
<i>         }  -> http://localhost:5001/
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:8080/
<i> [webpack-dev-server] On Your Network (IPv4): http://111.222.333.444:8080/
<i> [webpack-dev-server] Content not from webpack is served from '/some/path/redash/redash/public' directory
<i> [webpack-dev-server] 404s will fallback to '/static/index.html'

`yarn webpack-dev-server` no longer recognises the existing
configuration, so this commit updates things to work.
@codecov
Copy link

codecov bot commented Jul 31, 2023

Codecov Report

Merging #6329 (ee25294) into master (ad39059) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #6329   +/-   ##
=======================================
  Coverage   60.75%   60.75%           
=======================================
  Files         153      153           
  Lines       12511    12511           
  Branches     1694     1694           
=======================================
  Hits         7601     7601           
  Misses       4684     4684           
  Partials      226      226           

@justinclift
Copy link
Member Author

Meh, I'm just going to merge this. It's fixing a current non-working situation. We can adjust things later on if it turns out to need it. 😄

@justinclift justinclift merged commit 39477c7 into master Jul 31, 2023
@justinclift justinclift deleted the webpack_dev_server_v1 branch July 31, 2023 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant