Stefan Ledin

Laravel Mix: Invalid configuration object

I was working with Tailwind CSS in a Laravel 8 project and was ”just” going to add Tailwind forms. Suddenly, I was facing this error message in my terminal:

[webpack-cli] Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

Fortunately, the solution was as always a quick googling away and found in this thread on GitHub. The first suggestion didn’t work for me, but this solution did the trick. Thanks to andymnc!

First, add the following to the package.json file:

”webpack”: ”^5.23.0”

Then, run these commands in your terminal:


$ npm uninstall sass
$ npm uninstall sass-loader
$ rm -rf node_modules
$ rm package-lock.json yarn.lock
$ npm cache clear –force
$ npm install

view raw

solution.sh

hosted with ❤ by GitHub

Done! Everything should be working again!