Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An unhandled exception occurred: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema. #1348

Open
Nagendra2109 opened this issue Mar 20, 2023 · 5 comments

Comments

@Nagendra2109
Copy link

Describe the Bug

After upgrading from Angular version 9 to Angular version 12 facing this webpack issue

Build is getting failed

  • Generating browser application bundles (phase: setup)...An unhandled exception occurred: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
  • configuration.entry['main'] should not contain the item 'C:\DP-V12\dp-core-ui\node_modules\webpack-dev-server\client\index.js?http://0.0.0.0:0&sockPath=/sockjs-node' twice.
    -> All modules are loaded upon startup. The last one is exported.
    See "C:\Users\NAGEND~1.P\AppData\Local\Temp\ng-3ctuKX\angular-errors.log" for further details.
    npm ERR! code ELIFECYCLE
    npm ERR! syscall spawn
    npm ERR! file C:\WINDOWS\system32\cmd.exe
    npm ERR! errno ENOENT
    npm ERR! [email protected] start: node -max-old-space-size=2048 ./node_modules/@angular/cli/bin/ng serve --proxy-config proxy.config.json --port 4201
    npm ERR! spawn ENOENT
    npm ERR!
    npm ERR! Failed at the [email protected] start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

Minimal Reproduction

extra-webpack.config.js

const singleSpaAngularWebpack = require('single-spa-angular/lib/webpack').default;

module.exports = (config, options) => {
const singleSpaWebpackConfig = singleSpaAngularWebpack(config, options);

// Feel free to modify this webpack config however you'd like to
singleSpaWebpackConfig.devServer.historyApiFallback = true;

return singleSpaWebpackConfig;
};

Expected Behavior

Build should be successfull

Screenshots

If applicable, add screenshots to help explain your problem.

Environment


Libs
- @angular/core version: "~12.2.0"
- "@angular-builders/custom-webpack": "12.1.3",
- "webpack": "^5.41.1",
- "single-spa": "^5.0.4",
- "single-spa-angular": "5.0.2",

For Tooling issues:
- Node version: 12.14.1
- Platform:  Windows 
Others:

Additional Context

Add any other context about the problem here.

@arturovt
Copy link
Collaborator

Can you provide a minimal reproducible example?

@Nagendra2109
Copy link
Author

Can you provide a minimal reproducible example?

Please find the Reproducible example in this repository

https://github.com/Nagendra2109/customwebpackissue

@arturovt
Copy link
Collaborator

I can't install dependencies: error An unexpected error occurred: "https://registry.yarnpkg.com/acn-iis-core-ui: Not found".

@Nagendra2109
Copy link
Author

Nagendra2109 commented Mar 31, 2023

I can't install dependencies: error An unexpected error occurred: "https://registry.yarnpkg.com/acn-iis-core-ui: Not found".

Hi, Can you take pull now i have made changes.

Edit: I have removed the dependencies which were creating errors.

@Nagendra2109
Copy link
Author

Did anyone checked this issue..?
can anyone please update on this...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants