-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error [ERR_STREAM_WRITE_AFTER_END]: write after end #120
Comments
I too am experiencing this issue, with a very simple function: exports.handler = async function(event, context) {
return {
statusCode: 200,
body: "Hello, World"
};
}; It has the same behavior with the I believe this is related to this PR: #116 |
Digging in a bit, I think the issue is here: https://github.com/netlify/netlify-lambda/pull/116/files#diff-3288939317efd62bfc509440d662cacaR138 The I'll see about putting in a PR. |
yikes, my bad. happy to take pr or if not i’ll fix ina couple hours mean while feel free to use v1.3.x for the time being |
@sw-yx It's all good, I've already put in a PR. 👍 |
Amazing, thanks for the super fast fix!!!!!!! |
I'm still experiencing the same issue (server quits after x seconds) with the new release (1.4.1) with the hello world example. Response with status 200 in 6 ms.
TypeError: Promise.race(...).finally is not a function
at …/node_modules/netlify-lambda/lib/serve.js:150:15
at Layer.handle [as handle_request] (…/node_modules/express/lib/router/layer.js:95:5)
at next (…/node_modules/express/lib/router/route.js:137:13)
at next (…/node_modules/express/lib/router/route.js:131:14)
at next (…/node_modules/express/lib/router/route.js:131:14)
at next (…/node_modules/express/lib/router/route.js:131:14)
at next (…/node_modules/express/lib/router/route.js:131:14)
at next (…/node_modules/express/lib/router/route.js:131:14)
at next (…/node_modules/express/lib/router/route.js:131:14)
at Route.dispatch (…/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (…/node_modules/express/lib/router/layer.js:95:5)
at …/node_modules/express/lib/router/index.js:281:22
at param (…/node_modules/express/lib/router/index.js:354:14)
at param (…/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (…/node_modules/express/lib/router/index.js:410:3)
at next (…/node_modules/express/lib/router/index.js:275:10)
Your lambda function took longer than 10 seconds to finish.
If you need a longer execution time, you can increase the timeout using the -t or --timeout flag.
Please note that default function invocation is 10 seconds, check our documentation for more information (https://www.netlify.com/docs/functions/#custom-deployment-options).
events.js:183
throw er; // Unhandled 'error' event
^
Error: write after end
at write_ (_http_outgoing.js:622:15)
at ServerResponse.write (_http_outgoing.js:617:10)
at handleInvocationTimeout (…/node_modules/netlify-lambda/lib/serve.js:20:12)
at Timeout._onTimeout (…/node_modules/netlify-lambda/lib/serve.js:146:11)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5) |
Hi @Aratramba, thats not good. what node version are you running? i realized promise.finally is only supported in node 10. we may need to rewrite to avoid using promise.finally. i checked using https://github.com/netlify/create-react-app-lambda and i'm on node 10 and it works fine. |
got rid of promise.finally with https://github.com/netlify/netlify-lambda/releases/tag/v1.4.2 cc @Aratramba |
you're right, I am on an older Node version |
I have this issue wit node |
I've got the same issue, every now and then the app crashes with 'write after end' error. I've got simple I/O functions on my Lamdas as well. |
Hi guys!
After entering
in the console and hitting e.g. http://localhost:9000/.netlify/functions/hello everything runs well and the console returns
but after a few seconds the localhost server stops and the console returns
The function behind hello is the standard example from this repository (async/await version).
Any ideas?
The text was updated successfully, but these errors were encountered: