Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running ng update @angular/core --from 7 --to 8 --migrate-only on 8.0.0 does not migrate #14565

Closed
filipesilva opened this issue May 29, 2019 · 3 comments · Fixed by #14567
Closed

Comments

@filipesilva
Copy link
Contributor

filipesilva commented May 29, 2019

🐞 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 #14553 (comment)

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
@filipesilva filipesilva added this to the 8.0.1 milestone May 29, 2019
devversion added a commit that referenced this issue May 29, 2019
With Angular CLI version 8, migrations cannot be re-run with the
`--migrate-only` flag as there was a recent regression introduced
in e406f00#diff-0d0a748fb9a38a7ccde08d9b42e70bce as it now passes
a normalized platform path to the `engine.createCollection` call.

This breaks as there is incorrect logic within
`node-modules-engine-host` that causes the schematic collection to be
searched within the `package.json#schematics` entry. This is incorrect
as migration schematics specify their migration schematics in a separate
schematic collection file which is part of `package.json#ng-update`.
i

Fixes #14565
devversion added a commit that referenced this issue May 29, 2019
With Angular CLI version 8, migrations cannot be re-run with the
`--migrate-only` flag as there was a recent regression introduced
in e406f00#diff-0d0a748fb9a38a7ccde08d9b42e70bce as it now passes
a normalized platform path to the `engine.createCollection` call.

This breaks as there is incorrect logic within
`node-modules-engine-host` that causes the schematic collection to be
searched within the `package.json#schematics` entry. This is incorrect
as migration schematics specify their migration schematics in a separate
schematic collection file which is part of `package.json#ng-update`.

Fixes #14565
devversion added a commit that referenced this issue May 29, 2019
With Angular CLI version 8, migrations cannot be re-run with the
`--migrate-only` flag as there was a recent regression introduced
in e406f00#diff-0d0a748fb9a38a7ccde08d9b42e70bce as it now passes
a normalized platform path to the `engine.createCollection` call.

This breaks as there is incorrect logic within
`node-modules-engine-host` that causes the schematic collection to be
searched within the `package.json#schematics` entry. This is incorrect
as migration schematics specify their migration schematics in a separate
schematic collection file which is part of `package.json#ng-update`.

Fixes #14565
alexeagle pushed a commit that referenced this issue May 30, 2019
With Angular CLI version 8, migrations cannot be re-run with the
`--migrate-only` flag as there was a recent regression introduced
in e406f00#diff-0d0a748fb9a38a7ccde08d9b42e70bce as it now passes
a normalized platform path to the `engine.createCollection` call.

This breaks as there is incorrect logic within
`node-modules-engine-host` that causes the schematic collection to be
searched within the `package.json#schematics` entry. This is incorrect
as migration schematics specify their migration schematics in a separate
schematic collection file which is part of `package.json#ng-update`.

Fixes #14565
alexeagle pushed a commit that referenced this issue May 30, 2019
With Angular CLI version 8, migrations cannot be re-run with the
`--migrate-only` flag as there was a recent regression introduced
in e406f00#diff-0d0a748fb9a38a7ccde08d9b42e70bce as it now passes
a normalized platform path to the `engine.createCollection` call.

This breaks as there is incorrect logic within
`node-modules-engine-host` that causes the schematic collection to be
searched within the `package.json#schematics` entry. This is incorrect
as migration schematics specify their migration schematics in a separate
schematic collection file which is part of `package.json#ng-update`.

Fixes #14565
@TunMyintThein1995
Copy link

Hello
what happen this error
viewchild

@PeterBMartinez
Copy link

PeterBMartinez commented Aug 1, 2019

@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

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants