Skip to content

Nuxt 3.0.0-rc.9 with Nitro 0.5.0 configuration error: Malformed Lambda proxy response #504

@rhumie

Description

@rhumie

Environment

Nuxt 3.0.0-rc.9 with Nitro 0.5.0

Reproduction

I build the Nuxt app with aws-lambda deployment setting and configured Amazon API Gateway proxy integration to work with this lambda function.
When I call my endpoint, I receive a configuration error and an HTTP 502 status code.

Execution failed due to configuration error: Malformed Lambda proxy response

Describe the bug

As I commented in the PR (#357 (comment)), this is due to the fact that cookies are returned in the response object.

For API Gateway to handle a Lambda function's response, the function must return output according to the following JSON format. Additional fields are not allowed.

{
    "isBase64Encoded": true|false,
    "statusCode": httpStatusCode,
    "headers": { "headerName": "headerValue", ... },
    "body": "..."
}

cf. https://aws.amazon.com/premiumsupport/knowledge-center/malformed-502-api-gateway/?nc1=h_ls

Additional context

Related Issues and PRs are as follows.

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions