Following the migration guide i try to run
ng generate @angular/material:mdc-migration
This is the output i get:
? Limit the migration to a specific directory? (Enter the relative path such as 'src/app/shared' or leave blank for all directories) src/app/shared
? What components do you want to migrate? Button, Card, Checkbox
Limiting migration to: src/app/shared
Migrating components:
button
card
checkbox
Migrating project: dummy-frontend
Cannot read properties of undefined (reading 'length')
UPDATE:
i was able to run the script folder by folder
we had the exact same error when migrating and we found that the components that were failing were the one with a
template
instead of atemplateUrl
, and with concatenation inside the template like this one:If you replace the quotes and concatenation by back tick the migration succeed: