After recently updating numerous packages in my Angular project, I encountered several compilation errors.
Previous package.json:
{
"name": "data-jitsu",
"version": "0.0.0",
... (old dependencies listed here)
}
New package.json:
{
"name": "data-jitsu",
"version": "0.0.0",
... (new dependencies listed here)
}
Upon running npm install
using the updated package.json file followed by ng serve
, multiple TS compilation errors were thrown:
ERROR in src/app/all-matches/all-matches.component.ts(35,39): error TS2339: Property 'takeUntil' does not exist on type 'Observable'. ... (more errors listed)
Much of these errors appeared to be related to rxjs, given that I upgraded from v5 to v6 which caused compatibility issues.
In an attempt to resolve the errors, I installed rxjs-compat with
npm install rxjs@6 rxjs-compat@6 --save
. However, this solution did not eliminate any of the existing errors.
Following recommendations, I ran ts-lint using the commands below for automation:
npm i -g rxjs-tslint
rxjs-5-to-6-migrate -p [path/to/tsconfig.json]
The output indicated no valid rules specified for JavaScript files, suggesting potential misuse of TypeScript conventions when working with rxjs.
Starting troubleshooting from the first error about 'takeUntil' method not existing on 'Observable', it became clear that module import errors like 'cannot find module foo' were prevalent throughout .ts files.
For instance, some import errors included: "@angular/core", "firebase/app", and "@angular/router". These problems are noticeable within app.module.ts as well.
If anyone has insights or solutions to address these importing issues, your assistance would be greatly appreciated!