Skip to content

Error [ERR_STREAM_WRITE_AFTER_END]: write after end #120

Closed
@designbuedchen

Description

@designbuedchen

Hi guys!

After entering

yarn netlify-lambda serve src/lambda

in the console and hitting e.g. http://localhost:9000/.netlify/functions/hello everything runs well and the console returns

Request from ::1: GET /.netlify/functions/hello
Response with status 400 in 25 ms.

but after a few seconds the localhost server stops and the console returns

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:173
throw er; // Unhandled 'error' event
^

Error [ERR_STREAM_WRITE_AFTER_END]: write after end
at write_ (_http_outgoing.js:584:17)
at ServerResponse.write (_http_outgoing.js:579:10)
at handleInvocationTimeout (/Git/mylocalrepository/node_modules/netlify-lambda/lib/serve.js:19:12)
at Timeout._onTimeout (/Git/mylocalrepository/node_modules/netlify-lambda/lib/serve.js:141:9)
at listOnTimeout (timers.js:327:15)
at processTimers (timers.js:271:5)
Emitted 'error' event at:
at writeAfterEndNT (_http_outgoing.js:646:7)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

The function behind hello is the standard example from this repository (async/await version).

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions