From 0f9d233895a42d8cf1f1e144909c8722f6988143 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 13 Mar 2025 15:28:19 -0400 Subject: [PATCH 1/2] Add solution to JSON.parse error --- pages/aws/common_issues.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pages/aws/common_issues.mdx b/pages/aws/common_issues.mdx index 0cf33cb..394dbc2 100644 --- a/pages/aws/common_issues.mdx +++ b/pages/aws/common_issues.mdx @@ -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 ()` 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 \ No newline at end of file From 2614b77d6268a188c22d3c8113247afddf8bf8bc Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 13 Mar 2025 20:52:37 -0400 Subject: [PATCH 2/2] remove specific lambda example --- package-lock.json | 18 ++++++++++++++++++ pages/aws/common_issues.mdx | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index c566ccc..6b7a26e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,9 @@ "react": "18.2.0", "react-dom": "18.2.0", "typescript": "4.9.3" + }, + "devDependencies": { + "prettier": "^3.5.2" } }, "node_modules/@babel/runtime": { @@ -4005,6 +4008,21 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/prettier": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/property-information": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz", diff --git a/pages/aws/common_issues.mdx b/pages/aws/common_issues.mdx index 394dbc2..a2f51db 100644 --- a/pages/aws/common_issues.mdx +++ b/pages/aws/common_issues.mdx @@ -115,6 +115,6 @@ If you are not using `yarn` and you see `yarn` related errors it might be solved #### `SyntaxError: Unexpected end of JSON input at JSON.parse ()` error -This error will occur when the server function is called with a Server Action request which doesn't include a body. +This error will occur when the server function is called with a Server Action request without a body. -For an AWS Lambda@Edge function, make sure the option `Include Body` is set for the CloudFront request hook \ No newline at end of file +Make sure that the body is correctly forwarded to the server function. \ No newline at end of file