components: bug(schematics): migration schmatics report error without much useful information

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

Cannot read properties of undefined (reading 'sourceSpan')

Reproduction

N/A

Expected Behavior

Report file, relevant module and other useful information.

Actual Behavior

Cannot read properties of undefined (reading 'sourceSpan') and nothing else.

Environment

  • Angular: 15.0.0
  • CDK/Material: 15.0.0

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I got the message “Cannot read properties of undefined (reading ‘text’)”

Latching onto this issue because it looks essentially the same.

Two differences though. The error is Cannot read properties of undefined (reading 'length') and limiting to certain components doesn’t change anything.

Would love some sort of verbose option to post something more meaningful.

Hello @wagnermaciel , I’m reporting back about the mdc migration.

Your undefined fix made it possible for the migration script to finish. I noticed this weird thing after migration:

image

Looks like multi line mat-card tag gave the migration script a hard time, and the previous error? Not sure if it’s the real cause. Anyway, I’m very glad that I can finish this migration by just adding a space.

I’m quite surprised that this is the only place where I have a mat-card that spanned multiple lines. I’d think there were more, given how often I use mat-card 😃