Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Output migration transforms eventEmitter.emit() into invalid output.emit() #58650

Copy link
Copy link
@cexbrayat

Description

@cexbrayat
Issue body actions

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

core

Is this a regression?

Yes

Description

The output migration transforms:

@Output() eventEmitter = new EventEmitter<string>();

// later
eventEmitter.emit();

into

eventEmitter = output<string>();

// later
eventEmitter.emit();

But the value is mandatory in the output.emit signature, so the application breaks.
The migration could generate emit(undefined) in that case, or add a TODO or only treat this in with the --best-effort-mode option.

To repro, in the following Stackblitz, run:

ng g @angular/core:signals --migrations=outputs --path=./ --no-best-effort-mode

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-h5tea2?file=src%2Fmain.ts

Please provide the exception or error you saw

✘ [ERROR] TS2554: Expected 1 arguments, but got 0. [plugin angular-compiler]

    src/main.ts:18:22:
      18 │     this.eventEmitter.emit();
         ╵                       ~~~~

  An argument for 'value' was not provided.

    node_modules/@angular/core/index.d.ts:8288:9:
      8288 │     emit(value: T): void;

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

Angular CLI: 19.0.0-rc.1
Node: 18.20.3
Package Manager: npm 10.2.3
OS: linux x64

Angular: 19.0.0-rc.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.0-rc.1
@angular-devkit/build-angular   19.0.0-rc.1
@angular-devkit/core            19.0.0-rc.1
@angular-devkit/schematics      19.0.0-rc.1
@schematics/angular             19.0.0-rc.1
rxjs                            7.8.1
typescript                      5.5.4
zone.js                         0.14.10

Anything else?

No response

Metadata

Metadata

Labels

area: migrationsIssues related to `ng update`/`ng generate` migrationsIssues related to `ng update`/`ng generate` migrationsbug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.