-
Notifications
You must be signed in to change notification settings - Fork 125
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
Does anyone account this error(content-length mismatch)? #552
Comments
@ReginaLiang Could you provide more details about how this error happened? The runtime version, the LWA version, the invoke mode, and how frequent did it happen? |
Sure, I used lambda to deploy a nextjs app, and the runtime version is Nodejs 18, the LWA version is 0.8.4. Then there is an api gateway http api to call this lambda. HTTP API sets up a proxy for all requests. Finally, Nextjs application can run successfully, But when fetching the background API, it will report |
@ReginaLiang can you provide more CloudWatch Logs related to the error message? |
FYI, This error is from Lambda. Thanks. |
From these logs, it seems the next.js app was trying to send a GET request to another API and failed with the error |
This is the Lambda payload. LWA will translate it into a HTTP request and send to your next.js web app. Could you add debug logging in your next.js web app to show the http request it received? Especially the content-length header and the actual body. |
In fact, my nextjs app does not receive any parameters from lambda, but simply requests other apis through fetch, Will this have an impact? |
Hmm, this doesn't seem like an issue with LWA. Could you share a simple example which can reproduce this issue? |
I will prepare a sample to reproduce this problem in my free time. I appreciate your help. |
I used the nextjs, then fetch api, will occur
Request body length does not match content-length header
.How to fix it?
Thanks.
The text was updated successfully, but these errors were encountered: