Nuxt 3.0.0-rc.9 with Nitro 0.5.0 configuration error: Malformed Lambda proxy response
See original GitHub issueEnvironment
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 (https://github.com/unjs/nitro/pull/357#issuecomment-1247562089), 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
Issue Analytics
- State:
- Created a year ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
3.0.0-rc.9 AWS Lambda SSR is broken with No match ... - GitHub
When I check the AWS Lambda logs, it returns this error, "No match found for location with path "/images/icons/gear.png" and is causing the...
Read more >Malformed Lambda Proxy Response — What causes it and ...
First, Malformed Lambda proxy response isn't really a configuration error because the problem lies in your Lambda code.
Read more >AWS lambda api gateway error "Malformed Lambda proxy ...
Usually, when you see Malformed Lambda proxy response , it means your response from your Lambda function doesn't match the format API ......
Read more >Search Results - CVE
A stack overflow vulnerability exists in /goform/setAutoPing in Tenda W6 V1.0.0.9(4122), which allows an attacker to construct ping1 parameters and ping2 ...
Read more >datake914 - Twitter
Nuxt 3.0.0-rc.9 with Nitro 0.5.0 configuration error: Malformed Lambda ... configured Amazon API Gateway proxy integration to work with this lambda functi.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, Nitro presets are fully extensible. Copy this file into your project, make the necessary changes, and set
nitro.entry
to point to your changed file…(Of course, we do plan to fix the issue in Nitro itself!)
@timmak I am using Nuxt 3.0.0-rc.11 with Nitro 0.5.4 and it works fine.
I specify in
nuxt.config.ts
to use customnitro.entry.ts
only whenprocess.env.NODE_ENV
is production.