Skip to content

ng g @angular/core:standalone throws when plural syntax is used in template (TextEncoder is not defined) #48940

Closed
angular/angular-cli
#24662

Description

@cexbrayat

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

core

Is this a regression?

No

Description

ng g @angular/core:standalone throws when a template uses the plural syntax

ng new standalone-migration --defaults
cd standalone-migration
ng update @angular/core@next @angular/cli@next --force
ng add @angular/localize
echo "<div>{ 0, plural, =0 {Nobody} }</div>" > src/app/app.component.html
ng g @angular/core:standalone --defaults

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

❯ ng g @angular/core:standalone --defaults
TextEncoder is not defined

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
... localize, 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?

ng serve/build/test are all working fine

Activity

  1. added
    area: migrations
    on Feb 3, 2023
  2. added this to the needsTriage milestone on Feb 3, 2023
  3. added
    P3
    cross-cutting: standalone
    on Feb 4, 2023
  4. modified the milestones: needsTriage, Backlog on Feb 4, 2023
  5. crisbeto commented on Feb 5, 2023

    @crisbeto
    Member

    This is a CLI bug. I've sent out angular/angular-cli#24662 to fix it.

  6. clydin commented on Feb 6, 2023

    @clydin
    Member

    While the CLI PR does avoid the crash, there may be more to this issue.
    Since the schematics are not emitting code via the compiler and the TextDecoder instance is lazily initialized, using the AOT compiler for metadata static analysis should probably not be causing an error in this case since there is no need for the digest to be calculated.

  7. angular-automatic-lock-bot commented on Mar 10, 2023

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3area: migrationsbugcross-cutting: standalonestate: has PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions