Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
See original GitHub issueBug report
What is the current behavior?
The npx size-limit
command fails with the following error
➜ ts-react-components-lib git:(hhimanshu/update-deps) ✗ npx size-limit
✖ Adding to empty webpack project
ERROR WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.entry['index'] should be an non-empty array.
-> A non-empty array of non-empty strings
at webpack (/Users/hhimanshu/code/prsnl/ts/ts-react-components-lib/node_modules/webpack/lib/webpack.js:31:9)
at /Users/hhimanshu/code/prsnl/ts/ts-react-components-lib/node_modules/@size-limit/webpack/run-webpack.js:5:20
at new Promise (<anonymous>)
at runWebpack (/Users/hhimanshu/code/prsnl/ts/ts-react-components-lib/node_modules/@size-limit/webpack/run-webpack.js:4:10)
at Object.step40 (/Users/hhimanshu/code/prsnl/ts/ts-react-components-lib/node_modules/@size-limit/webpack/index.js:88:38)
at /Users/hhimanshu/code/prsnl/ts/ts-react-components-lib/node_modules/size-limit/calc.js:17:47
at Array.map (<anonymous>)
at step (/Users/hhimanshu/code/prsnl/ts/ts-react-components-lib/node_modules/size-limit/calc.js:16:29)
at calc (/Users/hhimanshu/code/prsnl/ts/ts-react-components-lib/node_modules/size-limit/calc.js:44:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
If the current behavior is a bug, please provide the steps to reproduce.
- Please checkout
hhimanshu/update-deps
branch from https://github.com/hhimanshu/ts-react-components-lib - Run
yarn install
- Run
yarn size
What is the expected behavior? The command should have ran successfully
Other relevant information:
The package.json
is available at https://github.com/hhimanshu/ts-react-components-lib/blob/hhimanshu/update-deps/package.json
webpack version:
Node.js version
➜ ts-react-components-lib git:(hhimanshu/update-deps) ✗ node -v
v14.17.0
➜ ts-react-components-lib git:(hhimanshu/update-deps) npm -v
7.17.0
➜ ts-react-components-lib git:(hhimanshu/update-deps)
Operating System: Mac Additional tools:
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Invalid configuration object. Webpack has been initialised ...
This error usually happens when you have conflicting version (angular js). So the webpack could not start the application ...
Read more >Invalid configuration object. Webpack has been ... - GitHub
Webpack has been initialised using a configuration object that does not match the API schema. - configuration.module.rules[3].type should be one ...
Read more >Webpack has been initialized using a configuration object
Webpack has been initialized using a configuration object that does not match the API schema. - configuration.module.rules[10] has an unknown property ...
Read more >Invalid configuration object. Webpack has been initialized ...
it throws an error: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
Read more >invalid configuration object. webpack has been - You.com
Webpack has been initialised using a configuration object that does not match the API schema is because the configuration file doesn't match the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hhimanshu Thanks for your response. I was able to solve this. Looks like the source of issue was little different than yours. That may because I am using a UI framework. Here are the details.
https://github.com/ant-design/ant-design-pro/issues/8828#issuecomment-890671623
Hello @tejparekh , in my case, it was because my expected file names in
package.json
did not match the ones produced byyarn build
. The related bug is https://github.com/ai/size-limit/issues/241 Check id this is the same thing in your case. Hope that helps