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

Options has an unknown property 'before' #83

Closed
gorkunov opened this issue Sep 6, 2021 · 6 comments · Fixed by #88
Closed

Options has an unknown property 'before' #83

gorkunov opened this issue Sep 6, 2021 · 6 comments · Fixed by #88
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@gorkunov
Copy link

gorkunov commented Sep 6, 2021

Seems overlay doesn't work with latest webpack-dev-server v4.1.0.

Error:

 - options has an unknown property 'before'. 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?, setupExitSignals?, static?, watchFiles?, webSocketServer? }

this line is broken:

options.devServer.before = (app, server) => {

@gregberge gregberge added the bug Something isn't working label Sep 12, 2021
@WizardCM
Copy link

WizardCM commented Sep 13, 2021

I can confirm I ran into the same issue today. Reproducible if the Webpack config has a simple

devServer: {}

And goes away if that option is not specified.

@thedavidprice
Copy link

Confirming this bug as well when trying to upgrade on RedwoodJS, which is using Webpack v5 and Webpack-dev-server v4 (compatible with v5).

There were many breaking changes in devServer v4:

Looks like this change here:

The before option was renamed to onBeforeSetupMiddleware and changed arguments.

...is potentially causing an issue here:

options.devServer.before = (app, server) => {

Additionally, it seems the following "sock*" changes will also cause problems:

public, sockHost, sockPath, and sockPort options were removed in favor client.webSocketURL option:

...over here:

sockOptions.sockHost = compiler.options.devServer.sockHost
sockOptions.sockPath = compiler.options.devServer.sockPath
sockOptions.sockPort = compiler.options.devServer.sockPort

@gregberge
Copy link
Owner

Hi, could someone work on a PR to fix it?

@thedavidprice
Copy link

If someone can lead on the PR, I am available to help with questions and diagnosing issues. Just loop me in if/as needed.

@gregberge gregberge added the help wanted Extra attention is needed label Sep 18, 2021
milosivanovic added a commit to milosivanovic/error-overlay-webpack-plugin that referenced this issue Oct 2, 2021
@milosivanovic
Copy link
Contributor

milosivanovic commented Oct 7, 2021

Hello! I posted a fix (#88) for this issue a week ago. @gregberge and @thedavidprice are you able to take a look?

@MichaelKheel
Copy link

Guys, please make a merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants