Caused by: other side closed

When deploying nhavantuonglai.com, I often get the error:

Caused by: other side closed
at TLSSocket. (node:internal/deps/undici/undici:6040:28)
at endReadableNT (node:internal/streams/readable:1696:12)
Error: Command “npm run build” exited with 1

I think the error does not come from the code, because the deploy process still succeeds if redeployed, however the failure is prolonged frequently, affecting my activities. Please tell me what the problem is and how I can solve it

This may be caused by a known issue which seems to be related to Node 20, and also has an ongoing GitHub discussion: Observations regarding instability of native fetch in AWS Lambda x86_64 nodejs20.x · Issue #3133 · nodejs/undici · GitHub

There’s a suggestion to add the connection: close header which should help resolve it: Observations regarding instability of native fetch in AWS Lambda x86_64 nodejs20.x · Issue #3133 · nodejs/undici · GitHub

Please give that a try and let me know how it goes!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.