angular/components · warning

${filePath}${lineAndCharacter} - ${message}

Error message

${filePath}${lineAndCharacter} - ${message}

What it means

The CDK update tool (`migrate` in UpdateTool) reports each migration failure as a CLI warning formatted as `<filePath>@line:col - <message>`. The migration result ends with `hasFailures: !!failures.length`, so consumers know the migration did not fully succeed. Each printed item is one spot the automated migration could not handle.

Source

Thrown at src/cdk/schematics/update-tool/index.ts:159

          }
        }
      });
    }

    // Call the "postAnalysis" method for each migration.
    migrations.forEach(r => r.postAnalysis());

    // Collect all failures reported by individual migrations.
    const failures = migrations.reduce(
      (res, m) => res.concat(m.failures),
      [] as MigrationFailure[],
    );

    // In case there are failures, print these to the CLI logger as warnings.
    if (failures.length) {
      failures.forEach(({filePath, message, position}) => {
        const lineAndCharacter = position ? `@${position.line + 1}:${position.character + 1}` : '';
        this._logger.warn(`${filePath}${lineAndCharacter} - ${message}`);
      });
    }

    return {
      hasFailures: !!failures.length,
    };
  }

  /**
   * Creates instances of the given migrations with the specified target
   * version and data.
   */
  private _createMigrations<Data>(
    types: MigrationCtor<Data, Context>[],
    target: TargetVersion | null,
    data: Data,
  ): Migration<Data, Context>[] {
    const result: Migration<Data, Context>[] = [];

View on GitHub (pinned to 0411926e7d)

Solutions

  1. Read each `<filePath>@line:col - message` warning and apply the described change manually.
  2. Fix compile errors in the project first, then re-run the migration so the AST analysis succeeds.
  3. If a failure is a tooling false positive, file an issue and apply the equivalent change by hand.

Example fix

// warning: src/app/list.component.html@4:7 - Could not migrate template API
<!-- before -->
<div mat-line *cdkTreeNodeDef></div>

<!-- after: manually migrate per the message -->
<ng-template cdkTreeNodeDef let-node><div mat-line></div></ng-template>
Defensive patterns

Strategy: validation

Validate before calling

const result = await tool.migrate();
if (result.hasFailures) {
  console.error('Migration incomplete; fix logged warnings before building.');
}

Prevention

When it happens

Trigger: Calling the update-tool's `migrate()` (or running `ng update` which invokes it) where the migration returned a `failures` array; each failure with a `position` is printed as `file@line:col - message`, without a position as `file - message`.

Common situations: Large upgrade across multiple CDK/Material major versions, code generated or formatted in ways the AST tools cannot match, or files failing to type-check before the migration runs.

Related errors


AI-assisted analysis of angular/components@0411926e7d (2026-08-31). Data as JSON: /api/errors/e0c4f11766211aea. Report an issue: GitHub.