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

bug(legacy/MDC-migration): catch-22 when trying to run the migration script #28510

Closed
1 task
vbraun opened this issue Jan 31, 2024 · 4 comments
Closed
1 task
Assignees
Labels
area: cdk/schematics cdk/schematics is *not* a public API P2 The issue is important to a large percentage of users, with a workaround

Comments

@vbraun
Copy link

vbraun commented Jan 31, 2024

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

TL;DR:

The legacy component migration script ng generate @angular/material:mdc-migration has a bug in v16 that was only fixed in v17. But you can't upgrade to v17 if you have legacy components. Reductio ad absurdum!

It would be great if a v16 release of the one-line fix from #28342 could be made.

Description

The current v16 release of @angular/material has a bug that does not allow the mdc migraiton script to run:

$ npx ng generate @angular/material:mdc-migration
? What components do you want to migrate? 
Schematic input does not validate against the Schema: {"directory":false,"components":[]}
Errors:

  Data path "/directory" must be string.

This was fixed in #28342 and released in 17.1.0-rc.0. The one-line fix works for me on 16.2.13.

Workaround

Manually apply 317eba0

Reproduction

N/A

Expected Behavior

ng generate @angular/material:mdc-migration should run

Actual Behavior

ng generate @angular/material:mdc-migration errors out

Environment

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

Angular CLI: 17.1.1
Node: 20.10.0
Package Manager: npm 10.2.3
OS: linux x64

Angular: 17.1.1
... animations, cli, common, compiler, compiler-cli, core
... elements, forms, language-service, localize
... platform-browser, platform-browser-dynamic, router, upgrade

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1701.1
@angular-devkit/build-angular   17.1.1
@angular-devkit/core            17.1.1
@angular-devkit/schematics      17.1.1
@angular/cdk                    16.2.13
@angular/material               16.2.13
@schematics/angular             16.2.9
ng-packagr                      17.1.2
rxjs                            7.8.1
typescript                      5.3.3
zone.js                         0.14.3
@vbraun vbraun added the needs triage This issue needs to be triaged by the team label Jan 31, 2024
@crisbeto
Copy link
Member

crisbeto commented Feb 1, 2024

We should definitely backport the fix, but I believe that you might be able to run the script with an older version of the CLI. I think the problematic change was either in 17.1 or one of the 17.0 patch releases.

@vbraun
Copy link
Author

vbraun commented Feb 1, 2024

I remember being able to run the migration earlier (months ago, forgot the actual version).

But at least in the 16.2.6 - 16.2.13 version range it doesn't work.

@crisbeto crisbeto self-assigned this Feb 1, 2024
@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround area: cdk/schematics cdk/schematics is *not* a public API and removed needs triage This issue needs to be triaged by the team labels Feb 1, 2024
@crisbeto
Copy link
Member

crisbeto commented Feb 1, 2024

Fixed in the 16.2.14 release.

@crisbeto crisbeto closed this as completed Feb 1, 2024
@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 Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: cdk/schematics cdk/schematics is *not* a public API P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

No branches or pull requests

2 participants