Open hatfieldjm4 opened 1 year ago
I first upgraded zone.js from v0.11.8 to v0.13.0 (npm install zone.js@0.13.0), suggested by the Angular Update Guide. Initial update command (npm run ng update @angular/core@16 @angular/cli@16) resulted in an error, so I specified the latest patch version and reversed the order of core and cli to cli and core:
npm run ng update @angular/cli@^16 @angular/core@^16
This appeared to run successfully, but after I tried to start the angular app locally, I received 2 errors (note these errors prevented localhost:4200 from compiling, but the app served on localhost:3000 seemingly normally):
I tried an “npm install” to see if this would fix the issue. These resulted in several peer dependency errors.
I noticed that @angular/cdk and @angular/material were both still running version 15.2.2 when I checked the Angular version (npm run ng version). To upgrade cdk and material, I used the following command:
npm run ng update @angular/cdk@^16 @angular/material@^16
After installing these two packages successfully, I started the local server, and again it failed to compile for localhost:4200.
Both ng-sidebar and @swimlane/ngx-charts will need to be addressed.
ng-sidebar: NPM said ng-sidebar has been deprecated and is no longer maintained. This will need to be addressed in the following files which mention “sidebar”:
@swimlane/ngx-charts: this package is still updated regularly, so I’m not sure what the issue is. Perhaps it just needs to be upgraded. I ran the following update: npm install @swimlane/ngx-charts@20.3.0. This resulted in an error: While resolving: @ng-select/ng-select@10.0.3 npm ERR! Found: @angular/common@16.0.3.
The only item that remains now is ng-sidebar. I've documented my fix to the @swimlane/ngx-charts issue in the GEAR Playbook, and I committed the Angular16 branch with all other dependencies resolved (except ng-sidebar).
I found a repo that someone forked off of the initial ng-sidebar repo, and they added configurability with Angular 16. I uninstalled ng-sidebar and installed the ng-sidebar-v2 library, made a quick edit to an import reference, and I was able to build and serve on 4200 successfully. I've saved my edits to the Angular16-hotfix branch. This ng-sidebar-v2 library may not be a viable long term solution, though. I'm not sure if the person will continually update it for upgraded versions of Angular. It only has about 8 downloads in the last week, according to npm.
Angular 16 was released May 3rd and is now an approved standard in GEAR. LTS of Angular 15 ends May 2024. Source: https://angular.io/guide/releases