laravel-mix: unknown property 'dev' using "run hot"

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "hot": "mix watch --hot"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "laravel-mix": "^6.0.18"
  },
  "dependencies": {
    "vue": "^2.6.12"
  }
}

Then do npm run hot and I get this:

Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.

  • configuration has an unknown property ‘dev’. These properties are valid: object { bonjour?, client?, compress?, devMiddleware?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, public?, setupExitSignals?, static?, transportMode?, watchFiles? }

There’s no webpack config and webpack.mix is emtpy.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17

Most upvoted comments

I temporarily fixed it by overriding the Webpack configuration generated by Laravel Mix:

mix.override(config => {
    // Apply a workaround caused by Laravel Mix using the `webpack-dev-server@v4.0.0-beta`:
    // https://github.com/webpack/webpack-dev-server/releases/tag/v4.0.0-beta.3.
    // Basically the `dev` property has been deprecated in favor of `devMiddleware`.
    if (config.devServer) {
        config.devServer.devMiddleware = config.devServer.dev;
        delete config.devServer.dev;
    }
});

😱😱😱

We’re gonna have to push out a fix for this and lock the version to a specific beta release (… we’re on a beta b/c of webpack 5 support). I didn’t realize that ^ would upgrade through different beta versions, apologies. I’ll see if I can take care of this today. (a PR would be welcome too!)

Plan:

  1. Upgrade to latest webpack-dev-server release — pinned to exactly a given version.
  2. Fix the config
  3. Verify tests pass
  4. Release new version

Anyone know how to fix this error when you try to use ‘npm run hot’? Thanks.

[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 ‘webpackbar’. These properties are valid: object { bonjour?, client?, compress?, devMiddleware?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, public?, setupExitSignals?, static?, transportMode?, watchFiles? }

Okay, thanks. I’ll spend some time tonight on it so we can bump it.

We’ve tagged 6.0.19. I opted to pin to beta 2 instead of upgrading to beta 3 as I don’t have the time at the moment to properly investigate. This should be good to go now though.

I’ve narrowed this down to the webpack-dev-server package version 4.0.0-beta.3.