question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

See original GitHub issue

Bug 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.

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:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
tejparekhcommented, Aug 2, 2021

@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

0reactions
hhimanshucommented, Jul 29, 2021

Hello @tejparekh , in my case, it was because my expected file names in package.json did not match the ones produced by yarn 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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found