diff --git a/examples/with-supabase/app/_examples/protected-route/page.tsx b/examples/with-supabase/app/_examples/protected-route/page.tsx index 97d252b29a9d..b3df6cf820f1 100644 --- a/examples/with-supabase/app/_examples/protected-route/page.tsx +++ b/examples/with-supabase/app/_examples/protected-route/page.tsx @@ -8,6 +8,8 @@ import { cookies } from 'next/headers' import Image from 'next/image' import { redirect } from 'next/navigation' +export const dynamic = 'force-dynamic' + export default async function ProtectedRoute() { const supabase = createServerComponentClient({ cookies }) diff --git a/examples/with-supabase/app/_examples/route-handler/route.ts b/examples/with-supabase/app/_examples/route-handler/route.ts index 9709709aca50..7e654a04bc51 100644 --- a/examples/with-supabase/app/_examples/route-handler/route.ts +++ b/examples/with-supabase/app/_examples/route-handler/route.ts @@ -4,6 +4,8 @@ import { createRouteHandlerClient } from '@supabase/auth-helpers-nextjs' import { cookies } from 'next/headers' import { NextResponse } from 'next/server' +export const dynamic = 'force-dynamic' + export async function GET() { // Create a Supabase client configured to use cookies const supabase = createRouteHandlerClient({ cookies }) diff --git a/examples/with-supabase/app/_examples/server-action/page.tsx b/examples/with-supabase/app/_examples/server-action/page.tsx index 4807e3e8d77c..de7443c67749 100644 --- a/examples/with-supabase/app/_examples/server-action/page.tsx +++ b/examples/with-supabase/app/_examples/server-action/page.tsx @@ -4,6 +4,8 @@ import { createServerActionClient } from '@supabase/auth-helpers-nextjs' import { revalidatePath } from 'next/cache' import { cookies } from 'next/headers' +export const dynamic = 'force-dynamic' + export default async function ServerAction() { const addTodo = async (formData: FormData) => { 'use server' diff --git a/examples/with-supabase/app/_examples/server-component/page.tsx b/examples/with-supabase/app/_examples/server-component/page.tsx index 3a82ced6a1bd..149c4de24e07 100644 --- a/examples/with-supabase/app/_examples/server-component/page.tsx +++ b/examples/with-supabase/app/_examples/server-component/page.tsx @@ -3,6 +3,8 @@ import { createServerComponentClient } from '@supabase/auth-helpers-nextjs' import { cookies } from 'next/headers' +export const dynamic = 'force-dynamic' + export default async function ServerComponent() { // Create a Supabase client configured to use cookies const supabase = createServerComponentClient({ cookies }) diff --git a/examples/with-supabase/app/auth/callback/route.ts b/examples/with-supabase/app/auth/callback/route.ts index dbb00609f69f..673099290c21 100644 --- a/examples/with-supabase/app/auth/callback/route.ts +++ b/examples/with-supabase/app/auth/callback/route.ts @@ -2,6 +2,8 @@ import { createRouteHandlerClient } from '@supabase/auth-helpers-nextjs' import { cookies } from 'next/headers' import { NextResponse } from 'next/server' +export const dynamic = 'force-dynamic' + export async function GET(request: Request) { // The `/auth/callback` route is required for the server-side auth flow implemented // by the Auth Helpers package. It exchanges an auth code for the user's session. diff --git a/examples/with-supabase/app/page.tsx b/examples/with-supabase/app/page.tsx index 472c5ce87482..acf064173665 100644 --- a/examples/with-supabase/app/page.tsx +++ b/examples/with-supabase/app/page.tsx @@ -5,6 +5,8 @@ import LogoutButton from '../components/LogoutButton' import SupabaseLogo from '../components/SupabaseLogo' import NextJsLogo from '../components/NextJsLogo' +export const dynamic = 'force-dynamic' + const resources = [ { title: 'Cookie-based Auth and the Next.js App Router', diff --git a/examples/with-supabase/package.json b/examples/with-supabase/package.json index 750ea08a6c6c..6ac8d3142b0b 100644 --- a/examples/with-supabase/package.json +++ b/examples/with-supabase/package.json @@ -19,6 +19,7 @@ "devDependencies": { "@types/node": "20.3.1", "@types/react": "18.2.12", - "@types/react-dom": "18.2.5" + "@types/react-dom": "18.2.5", + "encoding": "^0.1.13" } }