error decoding lambda response: error decoding lambda response: json: cannot unmarshal number into Go struct field APIGatewayProxyResponse.multiValueHeaders of type string
The page was running smothly the last 7 days with no issues and changes made. Now one of a sudden, this message appears yesterday night.
The page is a React Next.js application.
Please help. It is live already. My customers getting angry
Same here, also with an Next.js application. Didnāt made any changes and now getting the same error. Seem especially happing with server side rendered pages which receives data from the api. Pages without data connection are working well. On localhost everything works well.
These errors are both in how you return values from your lamdba. We did recently add some better support for multivalue headers that might have changed things, but as of today, everything - header, body, etc, needs to be JSON.stringify()'d like this:
When you donāt do that for something that is being returned from your lambda, youāll receive errors like the above.
Hi @FollowJack, around that time, we did add support for multiValueHeaders in Lambda Function response. That link you mentioned looks to have addressed the change. Iād be interested to hear the experience of the others that reported this issue and if that update mentioned also fixed their issue.
Iām trying to use multiValueHeaders in Netlify function response to set multiple cookies. It works locally with Netlify dev but not when deployed. Any ideas?
I ended up having some values in the multiValueHeaders property that did not have multiple values lol Guess that was a problem. Iām setting multiple cookies like this.
This code looks very familiar! Which makes me think that youāre seeing the same error as the OP but for a different reason. We worked through something similar over here:
Want to check out that thread and let us know if it helps you resolve the issue?
Hello Jen,
I have no node_modules in my lambda folder (like the topic tha you sent me to check). I use just one package.json and it is in the project root.
Works fine in local but Netlify throws a 502 error. I still need to run npm i inside my lambda folder?