From 88d3c3928d9026db5dc2876c49579377eef2dea0 Mon Sep 17 00:00:00 2001 From: Zino Hofmann Date: Sun, 27 Aug 2023 17:38:43 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=93=9D=20update=20app=20dir=20dem?= =?UTF-8?q?o=20to=20fix=20server=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/with-app-router/src/app/client-side/page.tsx | 2 ++ examples/with-app-router/src/app/server-side/page.tsx | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/examples/with-app-router/src/app/client-side/page.tsx b/examples/with-app-router/src/app/client-side/page.tsx index 109f57ff..03c09619 100644 --- a/examples/with-app-router/src/app/client-side/page.tsx +++ b/examples/with-app-router/src/app/client-side/page.tsx @@ -13,3 +13,5 @@ export default function ClientSide() { ); } + +export const dynamic = 'force-dynamic'; diff --git a/examples/with-app-router/src/app/server-side/page.tsx b/examples/with-app-router/src/app/server-side/page.tsx index 321ff6c6..c48bee5d 100644 --- a/examples/with-app-router/src/app/server-side/page.tsx +++ b/examples/with-app-router/src/app/server-side/page.tsx @@ -11,3 +11,8 @@ export default function ServerSide() { ); } + +// By default server components are statically generated at build-time. To make +// sure the env vars are actually loaded use, add the following line to server +// components that use [env]. 👇 +export const dynamic = 'force-dynamic';