0

I am trying upgrade my project to angular. My package.json looks like below

"dependencies": {
"@angular/animations": "^14.1.3",
"@angular/cdk": "^14.1.3",
"@angular/common": "^14.1.3",
"@angular/compiler": "^14.1.3",
"@angular/core": "^14.1.3",
"@angular/flex-layout": "^14.0.0-beta.40",
"@angular/forms": "^14.1.3",
"@angular/material": "^14.1.3",
"@angular/material-moment-adapter": "^14.1.3",
"@angular/platform-browser": "^14.1.3",
"@angular/platform-browser-dynamic": "^14.1.3",
"@angular/router": "^14.1.3",
"file-saver": "^2.0.5",
"keycloak-angular": "^12.1.0" }

I have keycloak dependency as well, as shown in the code above, it is also upgrade to latest which support angular 14.

We are getting below exceptions while I am building the project.

TypeError: Cannot create property 'message' on string '/home/ratna/opt/work/others/kevin/utilmate/utilman-ui/node_modules/keycloak-angular/fesm2015/keycloak-angular.mjs: This application depends upon a library published using Angular version 14.1.3, which requires Angular version 14.0.0 or newer to work correctly.
Consider upgrading your application to use a more recent version of Angular.
  302 | }
  303 | CoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: CoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
> 304 | CoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: CoreModule, imports: [CommonModule] });
      |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  305 | CoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: CoreModule, providers: [
  306 |         KeycloakService,
  307 |         {'
    at run (/home/ratna/opt/work/others/kevin/utilmate/utilman-ui/node_modules/@angular-builders/custom-webpack/node_modules/@babel/core/lib/transformation/index.js:37:15)
    at run.next (<anonymous>)
    at Function.transform (/home/ratna/opt/work/others/kevin/utilmate/utilman-ui/node_modules/@angular-builders/custom-webpack/node_modules/@babel/core/lib/transform.js:25:41)
    at transform.next (<anonymous>)
    at step (/home/ratna/opt/work/others/kevin/utilmate/utilman-ui/node_modules/gensync/index.js:261:32)
    at /home/ratna/opt/work/others/kevin/utilmate/utilman-ui/node_modules/gensync/index.js:273:13
    at async.call.result.err.err (/home/ratna/opt/work/others/kevin/utilmate/utilman-ui/node_modules/gensync/index.js:223:11)
    at /home/ratna/opt/work/others/kevin/utilmate/utilman-ui/node_modules/gensync/index.js:189:28
    at /home/ratna/opt/work/others/kevin/utilmate/utilman-ui/node_modules/@angular-builders/custom-webpack/node_modules/@babel/core/lib/gensync-utils/async.js:73:7
    at /home/ratna/opt/work/others/kevin/utilmate/utilman-ui/node_modules/gensync/index.js:113:33

Error: node_modules/@angular/router/index.d.ts:827:6 - error TS1023: An index signature parameter type must be either 'string' or 'number'.

827     [key: string | symbol]: any;
         ~~~


Error: node_modules/@angular/router/index.d.ts:2034:6 - error TS1023: An index signature parameter type must be either 'string' or 'number'.

2034     [key: string | symbol]: any | ResolveFn<unknown>;
          ~~~

Currently my project is in ng-12.2.13 If anyone had same issues, please help how solved it.

nani21984
  • 911
  • 2
  • 13
  • 21

0 Answers0