From 1f41a9ba30dfccf32cf758415f0cb874012c5c11 Mon Sep 17 00:00:00 2001 From: Pham Viet Hung *David Date: Thu, 20 Jun 2024 18:02:42 +0800 Subject: [PATCH] Updated Convert an SSR App to SSG (Due to NextJS latest version next export is not avaible) - NextJS from v13.3.0 next export already deprecated, and has been removed from version v14.0.0 and replace by "output" : "export", so for now if using the current document approach, it will causing error when building refer to this official document: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports --- FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FAQ.md b/FAQ.md index a3cb6c9..06ebe6c 100644 --- a/FAQ.md +++ b/FAQ.md @@ -286,7 +286,7 @@ frontend: ... ``` -3. Update the build command in your package.json to use `next export`, then commit this to trigger a new non SSR build. +3. Update the build command in your `next.config.js` to add `output: 'export'` inside the `nextConfig` (`v14.0.0` **next export** has been **removed** in favor of **"output": "export"**), then commit this to trigger a new non SSR build. 4. Finally, go to the `Rewrites and redirects` tab in the Amplify Hosting, and delete the first rewrite rule that was re-writing to your SSR CloudFront Distribution.