Angular-cli: Running `ng update @angular/core --from 7 --to 8 --migrate-only` on 8.0.0 does not migrate

Created on 29 May 2019  路  3Comments  路  Source: angular/angular-cli

馃悶 Bug report

Command (mark with an x)


- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes

Description

Followup to https://github.com/angular/angular-cli/issues/14553#issuecomment-496915624

Running ng update @angular/core --from 7 --to 8 --migrate-only on 8.0.0 does not migrate.
But going back to rc.0 will prompt the migration again.

馃敩 Minimal Reproduction

  • setup repository
git clone https://github.com/rip222/viewChild-test-ng8
cd viewChild-test-ng8
npm i
  • try to migrate and it fails
kamik@RED-X1C6 MINGW64 /d/sandbox/viewChild-test-ng8 (master)
$ ng update @angular/core --from 7 --to 8 --migrate-only
Using package manager: 'npm'
Collecting installed dependencies...
Found 30 dependencies.
Package "@angular\\core\\schematics\\migrations.json" was found but does not support schematics.
  • npm install @angular/[email protected] --save-exact --save-dev, commit to git
  • try to migrate again and it succeeds
kamik@RED-X1C6 MINGW64 /d/sandbox/viewChild-test-ng8 (master)
$ ng update @angular/core --from 7 --to 8 --migrate-only
            ------ Static Query Migration ------
            With Angular version 8, developers need to
            explicitly specify the timing of ViewChild and
            ContentChild queries. Read more about this here:
            https://v8.angular.io/guide/static-query-migration
            ------------------------------------------------
UPDATE src/app/app.component.ts (309 bytes)

馃敟 Exception or Error


$ ng update @angular/core --from 7 --to 8 --migrate-only
Using package manager: 'npm'
Collecting installed dependencies...
Found 30 dependencies.
Package "@angular\\core\\schematics\\migrations.json" was found but does not support schematics.

馃實 Your Environment


Angular CLI: 8.0.0
Node: 10.10.0
OS: win32 x64
Angular: 8.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.0
@angular-devkit/build-angular     0.800.0
@angular-devkit/build-optimizer   0.800.0
@angular-devkit/build-webpack     0.800.0
@angular-devkit/core              8.0.0
@angular-devkit/schematics        8.0.0
@ngtools/webpack                  8.0.0
@schematics/angular               8.0.0
@schematics/update                0.800.0
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.30.0
schematicupdate high regression bufix

Most helpful comment

@TunMyintThein1995 That is because the angular team changed the functionality of ViewChild so now you have you change it to something similar to this,
@ViewChild(MatSort, {static: false}) sort: MatSort;
Here is a link to the documentation about the different meta properties that you can now use.
https://angular.io/api/core/ViewChild

All 3 comments

Hello
what happen this error
viewchild

@TunMyintThein1995 That is because the angular team changed the functionality of ViewChild so now you have you change it to something similar to this,
@ViewChild(MatSort, {static: false}) sort: MatSort;
Here is a link to the documentation about the different meta properties that you can now use.
https://angular.io/api/core/ViewChild

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._

Was this page helpful?
0 / 5 - 0 ratings