Skip to content

bug(migration): after ng update some Legacy imports are broken #26223

Closed
@Marax

Description

@Marax

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

I've updated angular from version 14 to 15.

There was lot of changes to the imports, but there are two which failed to update correctly:
import {MatDialog} from '@angular/material/dialog';
changed to:
import {MMatLegacyDialog as MatDialog from '@@angular/material/legacy-dialog;
(double MM missing } after MatDialog and missing ' at the end.

and also this
import {FloatLabelType} from '@angular/material/form-field';
to this
import {LegacyFloatLabelType} from '@angular/material/legacy-form-field';
missin as FloatLabelType

For the second one I think problem could be that here

{old: 'LegacyFloatLabelType', new: 'LegacyFloatLabelType'},
both old/new lines are with Legacy prefix

Reproduction

Steps to reproduce:

  1. Have angular 14 with file containing
    import {FloatLabelType} from '@angular/material/form-field';
    import {MatDialog} from '@angular/material/dialog';
    imports
  2. run ng update @angular/material@15
  3. see broken imports

Expected Behavior

Imports should be correctly migrated.

Actual Behavior

Imports are broken as mentioned above.

Environment

  • Angular: 14 to 15
  • CDK/Material: 15
  • Browser(s): N/A
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions