Skip to content

[aws] Add solution to JSON.parse error #94

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pages/aws/common_issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,9 @@ This error is usually resolved by removing all yarn files in your repo. You shou
If you use `yarn` there is a workaround [here](https://stackoverflow.com/a/76902985https://stackoverflow.com/a/76902985).

If you are not using `yarn` and you see `yarn` related errors it might be solved by running `corepack disable` or updating `nvm` to `0.40.2`.

#### `SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>)` error

This error will occur when the server function is called with a Server Action request which doesn't include a body.

For an AWS Lambda@Edge function, make sure the option `Include Body` is set for the CloudFront request hook
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can happen for API gateway as well, and probably some other places. Maybe something more generic first like Make sure that the body is properly forwarded to the server function and then for example on lamdba@edge ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the lambda edge example since it's a non-standard setup.