question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed Migration During Upgrade from Angular 9 to Angular 10

See original GitHub issue

🐞 Bug report

Command

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

N/A

Description

When upgrading from Angular 9 to Angular 10, one of the automatic migrations fails.

🔬 Minimal Reproduction

$ git clone -b feature https://github.com/ebenh/ngx-mat-tel-input.git
$ npm install
$ npx @angular/cli@10 update @angular/core@10 @angular/cli@10 --force

🔥 Exception or Error

✖ Migration failed: Cannot read properties of undefined (reading 'Loose')
  See "/tmp/ng-5dsb1D/angular-errors.log" for further details.

Contents of /tmp/ng-5dsb1D/angular-errors.log

[error] TypeError: Cannot read properties of undefined (reading 'Loose')
    at readJsonFileAsAstObject (/home/eben/Repositories/foo/ngx-mat-tel-input/node_modules/@schematics/angular/migrations/update-9/utils.js:90:74)
    at Object.getWorkspace (/home/eben/Repositories/foo/ngx-mat-tel-input/node_modules/@schematics/angular/migrations/update-9/utils.js:77:21)
    at /home/eben/Repositories/foo/ngx-mat-tel-input/node_modules/@schematics/angular/migrations/update-9/schematic-options.js:15:35
    at MergeMapSubscriber.project (/tmp/angular-cli-packages-xt8UYc/node_modules/@angular-devkit/schematics/src/rules/call.js:75:24)
    at MergeMapSubscriber._tryNext (/tmp/angular-cli-packages-xt8UYc/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
    at MergeMapSubscriber._next (/tmp/angular-cli-packages-xt8UYc/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
    at MergeMapSubscriber.Subscriber.next (/tmp/angular-cli-packages-xt8UYc/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Observable._subscribe (/tmp/angular-cli-packages-xt8UYc/node_modules/rxjs/internal/util/subscribeToArray.js:5:20)
    at Observable._trySubscribe (/tmp/angular-cli-packages-xt8UYc/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/tmp/angular-cli-packages-xt8UYc/node_modules/rxjs/internal/Observable.js:30:22)

🌍 Your Environment

Output of npx ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 10.2.3
Node: 16.13.0
OS: linux x64

Angular: 10.2.5
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1002.3
@angular-devkit/build-angular      0.1002.3
@angular-devkit/build-ng-packagr   0.1002.3
@angular-devkit/core               10.2.3
@angular-devkit/schematics         10.2.3
@angular/cdk                       9.2.4
@angular/cli                       10.2.3
@angular/flex-layout               12.0.0-beta.34
@angular/material                  9.2.4
@schematics/angular                10.2.3
@schematics/update                 0.1002.3
ng-packagr                         10.1.2
rxjs                               6.5.5
typescript                         4.0.8

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
Romulo-Scommented, Nov 8, 2021

Thanks! It worked on gitbash. image

0reactions
angular-automatic-lock-bot[bot]commented, Dec 9, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Guide to update your Angular application v9.0 -> v10.0 for ...
Review these changes and perform the actions to update your application. Make sure you are using Node 12 or later. Run npx @angular/cli@10...
Read more >
Trouble upgrading from angular 9 to angular 10 - Stack Overflow
× Migration failed: Incompatible peer dependencies found. Peer dependency warnings when installing dependencies means that those dependencies ...
Read more >
Upgrading to Angular 10 - YouTube
Learn how to upgrade an Angular application to Angular 10. We'll use a real application, and migrate it from Angular 8 to Angular...
Read more >
How To Update Angular CLI To Latest Version
To update Angular CLI version in your local projects use the following commands. Navigate to your local Angular project folder and execute the ......
Read more >
Angular Version Upgrade: A quick guide to upgrade from 9.0 ...
3. Perform an upgrade to angular's core and cli modules to version10.0 from the current version. The --force switch at the end is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found