Skip to content

new application isn't "modern" according to modernize tool from mcp server #32156

@markgoho

Description

@markgoho

Command

generate

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

when generating a new application, then running the modernize tool from the Angular MCP server the following changes are made:

// app.ts
@Component({
  selector: 'app-root',
  imports: [RouterOutlet],
  templateUrl: './app.html',
  styleUrl: './app.css',
  changeDetection: ChangeDetectionStrategy.OnPush, // added
})


// app.config.ts
export const appConfig: ApplicationConfig = {
  providers: [
    provideZonelessChangeDetection(), // added
    provideBrowserGlobalErrorListeners(),
    provideRouter(routes),
  ],
};

this is either a shortcoming of the application generator (missing those two additions) or a hallucination on part of the MCP server (adding properties that don't need to be added)

Minimal Reproduction

ng new

install mcp server

prompt "please modernize my angular application"

Exception or Error


Your Environment

Angular CLI       : 21.0.3
Angular           : 21.0.5
Node.js           : 22.19.0
Package Manager   : npm 10.9.3
Operating System  : darwin arm64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 21.0.3            │ ^21.0.3           │
│ @angular/cli              │ 21.0.3            │ ^21.0.3           │
│ @angular/common           │ 21.0.5            │ ^21.0.0           │
│ @angular/compiler         │ 21.0.5            │ ^21.0.0           │
│ @angular/compiler-cli     │ 21.0.5            │ ^21.0.0           │
│ @angular/core             │ 21.0.5            │ ^21.0.0           │
│ @angular/forms            │ 21.0.5            │ ^21.0.0           │
│ @angular/platform-browser │ 21.0.5            │ ^21.0.0           │
│ @angular/router           │ 21.0.5            │ ^21.0.0           │
│ rxjs                      │ 7.8.2             │ ~7.8.0            │
│ typescript                │ 5.9.3             │ ~5.9.2            │
│ vitest                    │ 4.0.16            │ ^4.0.8            │

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions