I am just trying to run a simple react hello world app But I am facing the following error Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema in ReactJS. We are going to Learn about All Possible Solutions So Lets Get Start with This Article.
- How Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema Error Occurs ?
- How To Solve Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema Error ?
- Solution 1: Change loader in webpack.config.js
- Solution 2: remove empty string in webpack.config.js
- Solution 3: Reinstall webpack
- Summary
How Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema Error Occurs ?
I am just trying to run a simple react hello world app But I am facing the following error.
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. – configuration has an unknown property ‘postcss’. These properties are valid: object
So here I am writing all possible solutions that I have tried to resolve this error.
How To Solve Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema Error ?
How To Solve Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema Error?
To Solve Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema Error First of all, just uninstall webpack with this command: npm uninstall webpack –save-dev Now, Reinstall webpack with this command: npm install webpack –save-dev I Hope, Your error should be solved now.
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema
To Solve Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema Error You need to change Loader in your webpack.config.js. Replace loaders to rules. Here is an Example: rules: [] Now, your error must be solved.
Solution 1: Change loader in webpack.config.js
You need to change Loader in your webpack.config.js. Replace loaders to rules. Here is an Example.
module: {
loaders: [
rules: [ // Replace loaders to rules
{
...
},
],
],
}
Now, your error must be solved.
Solution 2: remove empty string in webpack.config.js
First of all, Open Your webpack.config.js file and look for module.exports>resolve>extensions if there is an empty string then just remove it. and Now, Your error must be solved.
module.exports = {
resolve: {
extensions: ['', '.js', '.jsx'] // Error
}
...
};
To Change
module.exports = {
resolve: {
extensions: ['.js', '.jsx'] //Working
}
...
};
Solution 3: Reinstall webpack
First of all, just uninstall webpack with this command.
npm uninstall webpack --save-dev
Now, Reinstall webpack with this command.
npm install webpack --save-dev
I Hope, Your error should be solved now.
Summary
It’s all About this error. Hope We solved Your error. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read