Skip to content

ng g @angular/core:standalone throws for empty component templates #48846

@cexbrayat

Description

@cexbrayat

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

core

Is this a regression?

No

Description

ng g @angular/core:standalone --mode convert-to-standalone --path ./ throws if a template is empty.

ng new standalone-migration --defaults
cd standalone-migration
ng update @angular/core@next @angular/cli@next --force
echo -n > src/app/app.component.html
ng g @angular/core:standalone --mode convert-to-standalone --path ./

throws:

HostResourceLoader: loader(/Users/cedric/Code/temp/standalone-migration/src/app/app.component.html) returned a Promise

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.1
Node: 16.17.0
Package Manager: npm 8.19.3
OS: darwin arm64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1502.0-next.1
@angular-devkit/build-angular   15.2.0-next.1
@angular-devkit/core            15.2.0-next.1
@angular-devkit/schematics      15.2.0-next.1
@angular/cli                    15.2.0-next.1
@schematics/angular             15.2.0-next.1
rxjs                            7.6.0
typescript                      4.8.4

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions