Skip to content

ng g @angular/core:standalone imports ɵInternalFormsSharedModule #48942

@cexbrayat

Description

@cexbrayat

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

No

Description

ng new standalone-migration --defaults
cd standalone-migration
ng update @angular/core@next @angular/cli@next --force
echo "<form [formGroup]="form"></form>" > src/app/app.component.html
# add `ReactiveFormsModule` to `app.module.ts`
# add a field `form = new FormGroup({})` to `app.component.ts`
ng g @angular/core:standalone --defaults --mode standalone-bootstrap

The migrated app.component.ts has an import ɵInternalFormsSharedModule

import { Component } from '@angular/core';
import { FormGroup, ɵInternalFormsSharedModule, ReactiveFormsModule } from '@angular/forms';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css'],
    standalone: true,
    imports: [ɵInternalFormsSharedModule, ReactiveFormsModule]
})
export class AppComponent {
  title = 'standalone-migration';
  form = new FormGroup({})
}

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 15.2.0-next.3
Node: 16.17.0
Package Manager: npm 8.19.3
OS: darwin arm64

Angular: 15.2.0-next.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.0-next.3
@angular-devkit/build-angular   15.2.0-next.3
@angular-devkit/core            15.2.0-next.3
@angular-devkit/schematics      15.2.0-next.3
@schematics/angular             15.2.0-next.3
rxjs                            7.8.0
typescript                      4.9.5

Anything else?

No response

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfularea: migrationsIssues related to `ng update`/`ng generate` migrationsbugcross-cutting: standaloneIssues related to the NgModule-less worldstate: has PR

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions