You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Output migration transforms eventEmitter.emit() into invalid output.emit() #58650
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
I agree that we could add a TODO, or skip in "safe mode", but IMO it would also be acceptable to say that we are intentionally breaking here and surfacing a real brittle problem in the user code (caused by the bad typings of EventEmitter clearly).
I would also prefer the code to break. IMO, that's clearly a bug that should be fixed.
BTW, another godd thing to do woulmd be to document what happens when emit is called without argument: does the parent component receive an undefined (and thus incorrectly typed) event? Is undefined somehow filtered out?
I agree that we could add a TODO, or skip in "safe mode", but IMO it would also be acceptable to say that we are intentionally breaking here and surfacing a real brittle problem in the user code
This was my thinking while authoring this migration. I've marked this issue as a "bug" so we can insert a TODO indicating why it is breaking / what a user should do in this case.
Activity
devversion commentedon Nov 14, 2024
I agree that we could add a TODO, or skip in "safe mode", but IMO it would also be acceptable to say that we are intentionally breaking here and surfacing a real brittle problem in the user code (caused by the bad typings of
EventEmitterclearly).can already break in subtle ways at runtime, given
undefinedbeing used as value, buteventEmitter.subscribeonly receiving values of type string.jnizet commentedon Nov 14, 2024
I would also prefer the code to break. IMO, that's clearly a bug that should be fixed.
BTW, another godd thing to do woulmd be to document what happens when emit is called without argument: does the parent component receive an
undefined(and thus incorrectly typed) event? Isundefinedsomehow filtered out?pkozlowski-opensource commentedon Nov 14, 2024
This was my thinking while authoring this migration. I've marked this issue as a "bug" so we can insert a TODO indicating why it is breaking / what a user should do in this case.
fix(core): fix ng generate @angular/core:output-migration. Fixes #58650…
fix(core): fix ng generate @angular/core:output-migration. Fixes #58650…
angular-automatic-lock-bot commentedon May 9, 2025
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.