Webpack-encore: webpack-dev-server is not working after upgrade to webpack 5

Created on 28 Jan 2021  路  1Comment  路  Source: symfony/webpack-encore

Hello,

I had an issue after a new installation of webpack encore (1.0) with symfony 5.2.2, and more specifically when I tried to run the webpack dev-server command, as explained on Symfony's official documentation (Using webpack-dev-server and HMR)

$ yarn encore dev-server

I got this error

[webpack-cli] Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
 - configuration has an unknown property 'watchOptions'. These properties are valid:
   object { bonjour?, client?, compress?, dev?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, injectClient?, injectHot?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, openPage?, overlay?, port?, proxy?, public?, setupExitSignals?, static?, stdin?, transportMode?, useLocalIp? }
error

I tried to downgrade the webpack encore package to the version 0.33.0 and it works fine without issues. Could you please check that, this should be an issue especially for users starting/upgrading symfony projects.

For more details, I'm using these versions:

  • Nodejs 14.15.4
  • Yarn 1.22.5
  • symfony/webpack-encore-bundle 1.9.0

Most helpful comment

Hey!

Yes, this was an oversight - we're tracking it at #893 and I'm opening a PR now :).

Cheers!

>All comments

Hey!

Yes, this was an oversight - we're tracking it at #893 and I'm opening a PR now :).

Cheers!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wenmingtang picture wenmingtang  路  4Comments

Aerendir picture Aerendir  路  4Comments

Growiel picture Growiel  路  4Comments

rebangm picture rebangm  路  4Comments

iammichiel picture iammichiel  路  3Comments