nitrojs / nitrojs/nitro

setCookie fails silently on aws-lambda preset with streaming enabled

Open
#3,228 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Environment

nitropack@2.11.6
lambda is running Node v20.x

Works fine locally, fails when deployed to a lambda

Reproduction

Github repo: https://github.com/mckamyk/nitro-lambda-streaming

Note that I included sst if you have aws-cli setup and authenticated already to make it faster and easier to deploy the lambda to test.

Otherwise you can create the lambda in the UI manually using the .output/server/index.mjs

Deployed link: https://eqxfwy3vd2v7qv3ush7ue7ij5e0lothx.lambda-url.us-east-1.on.aws/

The request in network dev tools should show a set-cookie: ... response header, it does not.

Describe the bug

I cannot use setCookie(...) when both the preset aws-lambda and awsLambda.streaming: true are set.

Additional context

No response

Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked nitro-lambda-streaming reproduction and the generated .output/server/index.mjs, deploying with the aws-lambda preset and awsLambda.streaming enabled. Trace the response handling for setCookie and verify completion by observing a set-cookie response header on the deployed Lambda URL.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, node.js, typescript
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.