angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Migration of application from Angular 12 to 13 leads to breaking changes via webpack 4

Open kunal00731 opened this issue 4 years ago • 2 comments

I am currently trying to migrate an application from Angular 12 to 13 . I am using webpack 4.43.0 in package.json (devDependecies) :

"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.1.2"

I had manually migrated all the required libraries to their corresponding version 13 and then when I run npm run start (start is the script present in the package.json ) to transpile and serve the code in the application, I keep getting the below errors :

ERROR in ./node_modules/@angular/common/fesm2015/http.mjs
Module not found: Error: Can't resolve '@angular/common' in 'C:\Kunal\node_modules\@angular\common\fesm2015'

ERROR in ./node_modules/@angular/forms/fesm2015/forms.mjs
Module not found: Error: Can't resolve '@angular/common' in 'C:\Kunal\node_modules\@angular\forms\fesm2015'

ERROR in ./node_modules/@angular/platform-browser-dynamic/fesm2015/platform-browser-dynamic.mjs
Module not found: Error: Can't resolve '@angular/common' in 'C:\Kunal\node_modules\@angular\platform-browser-dynamic\fesm2015'

ERROR in ./node_modules/@angular/platform-browser/fesm2015/platform-browser.mjs
Module not found: Error: Can't resolve '@angular/common' in 'C:\Kunal\node_modules\@angular\platform-browser\fesm2015'

ERROR in ./node_modules/@angular/router/fesm2015/router.mjs
Module not found: Error: Can't resolve '@angular/common' in 'C:\Kunal\node_modules\@angular\router\fesm2015'

ERROR in ./node_modules/@angular/platform-browser-dynamic/fesm2015/platform-browser-dynamic.mjs
Module not found: Error: Can't resolve '@angular/compiler' in 'C:\Kunal\node_modules\@angular\platform-browser-dynamic\fesm2015'

-------- etc.

I have no idea as to why migration from 12 to 13 will cause the issues mentioned up above .

Package.json :

"dependencies": {
  "@angular/common": "13.3.11",
  "@angular/compiler": "13.3.11",
  "@angular/core": "13.3.11",
  "@angular/forms": "13.3.11",
  "@angular/platform-browser": "13.3.11",
  "@angular/platform-browser-dynamic": "13.3.11",
  "@angular/router": "13.3.11",
  "@azure/msal-browser": "2.16.0",
  "@ng-idle/core": "11.0.3",
  "@ng-idle/keepalive": "11.0.3",
  "@types/file-saver": "1.3.0",
  "@types/jest": "26.0.24",
  "ag-grid": "15.0.0",
  "ag-grid-angular": "15.0.0",
  "angular-calendar": "0.28.28",
  "angular-draggable-droppable": "4.6.0",
  "angular-polyfills": "1.0.1",
  "angular-resizable-element": "3.4.0",
  "angular2-uuid": "1.1.1",
  "bootstrap": "3.4.1",
  "copy-webpack-plugin": "6.4.1",
  "core-js": "3.17.3",
  "file-saver": "1.3.8",
  "font-awesome": "4.7.0",
  "http-proxy": "1.18.1",
  "ng2-completer": "9.0.1",
  "ng2-tabs": "0.0.11",
  "ngx-bootstrap": "5.6.2",
  "ngx-mydatepicker": "2.4.11",
  "rxjs": "6.6.6",
  "terser-webpack-plugin": "3.1.0",
  "ts-helpers": "1.1.2",
  "ts-loader": "8.0.4",
  "tslib": "2.3.1",
  "xlsx": "0.11.6",
  "zone.js": "0.11.4"
},
"devDependencies": {
  "@angular/animations": "13.3.11",
  "@angular/cli": "13.3.8",
  "@angular/compiler-cli": "13.3.11",
  "@types/jasmine": "3.6.0",
  "@types/jasminewd2": "2.0.3",
  "@types/node": "12.11.1",
  "@types/systemjs": "0.20.8",
  "angular2-template-loader": "0.6.2",
  "calendar-utils": "0.0.58",
  "codelyzer": "4.5.0",
  "css-loader": "0.28.10",
  "date-fns": "1.30.1",
  "extract-text-webpack-plugin": "4.0.0-beta.0",
  "file-loader": "1.1.11",
  "html-loader": "0.5.5",
  "html-webpack-plugin": "4.5.2",
  "istanbul-instrumenter-loader": "3.0.0",
  "jasmine-core": "3.8.0",
  "jasmine-spec-reporter": "5.0.2",
  "jquery": "3.6.0",
  "json-loader": "0.5.7",
  "karma": "6.3.2",
  "karma-chrome-launcher": "3.1.0",
  "karma-cli": "2.0.0",
  "karma-coverage": "2.0.3",
  "karma-coverage-istanbul-reporter": "3.0.2",
  "karma-htmlfile-reporter": "0.3.8",
  "karma-jasmine": "4.0.0",
  "karma-jasmine-html-reporter": "1.7.0",
  "karma-junit-reporter": "2.0.1",
  "karma-remap-coverage": "0.1.5",
  "karma-sonarqube-unit-reporter": "0.0.23",
  "karma-sourcemap-loader": "0.3.8",
  "karma-story-reporter": "0.3.1",
  "karma-webpack": "4.0.2",
  "ngx-order-pipe": "1.0.3",
  "node-sass": "6.0.1",
  "null-loader": "0.1.1",
  "protractor": "7.0.0",
  "protractor-angular-screenshot-reporter": "0.1.2",
  "raw-loader": "0.5.1",
  "rimraf": "2.7.1",
  "sass-loader": "6.0.7",
  "style-loader": "0.20.3",
  "ts-node": "8.3.0",
  "tslint": "6.1.3",
  "typescript": "4.4",
  "webpack": "4.43.0",
  "webpack-cli": "3.3.12",
  "webpack-dev-server": "3.11.0",
  "webpack-merge": "4.1.2"
}

kunal00731 avatar Jul 07 '22 14:07 kunal00731

Setups with custom webpack configurations are not support by the Angular team.

alan-agius4 avatar Jul 07 '22 14:07 alan-agius4

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.