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
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
19.1.3
Description
When updating to angular 19.2.2 we see a regression while running SSR inside an AWS lambda. Local tests with a 3rd party lib lambda-local shows that response was created by angularNodeAppEngine, but writeResponseToNodeResponse does not seem to resolve anymore as before and lambda process will result in a timeout.
Minimal Reproduction
Reverting locally the changes of #29491 made it work again.
Further debugging: f (!canContinue) { console.log('destination.write()', canContinue); await new Promise((resolve) => destination.once('drain', resolve)); }
strangely shows canContinue as undefined.
This will output the angular response to console and then it runs into the default timeout of 3 seconds.
Sidenodes:
I've added also a console log when writeResponseToNodeResponse resolves which is not coming, so this is why I think somehow the added promise in the pull request is now stuck due to the undefined and maybe that drain event is not fired.
I can't rule out if it is an error in the used serverless package translating the lambda event into a request object, but like I've said removing that change from the pull request locally is solving this problem.
Activity
alan-agius4 commentedon Mar 11, 2025
Hi @dklmuc, it would be great to have a reproduction. However, OutgoingMessage
.writeshould never returnundefined.dklmuc commentedon Mar 11, 2025
@alan-agius4 yes, this is also what is confusing me after reading the node docs for
.writeI've added a small repro: https://github.com/dklmuc/angular-srr-lambda
This will output the angular response to console and then it runs into the default timeout of 3 seconds.
Sidenodes:
I've added also a console log when
writeResponseToNodeResponseresolves which is not coming, so this is why I think somehow the added promise in the pull request is now stuck due to theundefinedand maybe that drain event is not fired.I can't rule out if it is an error in the used serverless package translating the lambda event into a request object, but like I've said removing that change from the pull request locally is solving this problem.
alan-agius4 commentedon Mar 11, 2025
Indeed, it does seem like a bug in the mentioned package. In fact there has been a long standing issue CodeGenieApp/serverless-express#683
For the time being we could potentially do a workaround.
fix(@angular/ssr): prevent stream draining if `write` does not return…
dklmuc commentedon Mar 11, 2025
@alan-agius4 thanks a lot for the quick help.
fix(@angular/ssr): prevent stream draining if `write` does not return…
fix(@angular/ssr): prevent stream draining if `write` does not return…
angular-automatic-lock-bot commentedon Apr 11, 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.