From 554ebbfad7ac309aedb3732ea4ac3f0b7e32e2ff Mon Sep 17 00:00:00 2001 From: Jon Meyers Date: Thu, 20 Jul 2023 20:18:33 +1000 Subject: [PATCH] fix errors in build --- .../app/auth-button-client.tsx | 7 ++--- .../app/auth-button-server.tsx | 2 ++ .../app/auth/callback/route.ts | 5 +++- .../app/login/page.tsx | 3 +- .../app/new-tweet.tsx | 6 +++- .../app/page.tsx | 3 +- .../package-lock.json | 30 +++++++++++++++++++ .../package.json | 3 ++ 8 files changed, 51 insertions(+), 8 deletions(-) diff --git a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth-button-client.tsx b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth-button-client.tsx index a478fcc..7f65db3 100644 --- a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth-button-client.tsx +++ b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth-button-client.tsx @@ -1,11 +1,10 @@ "use client"; -import { - Session, - createClientComponentClient, -} from "@supabase/auth-helpers-nextjs"; +import { createClientComponentClient } from "@supabase/auth-helpers-nextjs"; import { useRouter } from "next/navigation"; +import type { Session } from "@supabase/auth-helpers-nextjs"; + export default function AuthButtonClient({ session, }: { diff --git a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth-button-server.tsx b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth-button-server.tsx index b3b60e5..67ba535 100644 --- a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth-button-server.tsx +++ b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth-button-server.tsx @@ -2,6 +2,8 @@ import { createServerComponentClient } from "@supabase/auth-helpers-nextjs"; import { cookies } from "next/headers"; import AuthButtonClient from "./auth-button-client"; +export const dynamic = "force-dynamic"; + export default async function AuthButtonServer() { const supabase = createServerComponentClient({ cookies }); const { diff --git a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth/callback/route.ts b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth/callback/route.ts index 0b9aa47..2603eb3 100644 --- a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth/callback/route.ts +++ b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/auth/callback/route.ts @@ -1,7 +1,10 @@ import { createRouteHandlerClient } from "@supabase/auth-helpers-nextjs"; import { cookies } from "next/headers"; +import { NextResponse } from "next/server"; -import { NextResponse, type NextRequest } from "next/server"; +import type { NextRequest } from "next/server"; + +export const dynamic = "force-dynamic"; export async function GET(request: NextRequest) { const requestUrl = new URL(request.url); diff --git a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/login/page.tsx b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/login/page.tsx index 79a5b8d..8ed2aca 100644 --- a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/login/page.tsx +++ b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/login/page.tsx @@ -1,9 +1,10 @@ import { createServerComponentClient } from "@supabase/auth-helpers-nextjs"; import { cookies } from "next/headers"; import { redirect } from "next/navigation"; -import AuthButtonClient from "../auth-button-client"; import GitHubButton from "./github-button"; +export const dynamic = "force-dynamic"; + export default async function Login() { const supabase = createServerComponentClient({ cookies }); diff --git a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/new-tweet.tsx b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/new-tweet.tsx index eccf67f..88f388c 100644 --- a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/new-tweet.tsx +++ b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/new-tweet.tsx @@ -1,7 +1,11 @@ -import { User, createServerActionClient } from "@supabase/auth-helpers-nextjs"; +import { createServerActionClient } from "@supabase/auth-helpers-nextjs"; import { cookies } from "next/headers"; import Image from "next/image"; +import type { User } from "@supabase/auth-helpers-nextjs"; + +export const dynamic = "force-dynamic"; + export default function NewTweet({ user }: { user: User }) { const addTweet = async (formData: FormData) => { "use server"; diff --git a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/page.tsx b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/page.tsx index c7e1a0e..a89db17 100644 --- a/20-deploy-next.js-app-router-project-to-production-with-vercel/app/page.tsx +++ b/20-deploy-next.js-app-router-project-to-production-with-vercel/app/page.tsx @@ -3,9 +3,10 @@ import { cookies } from "next/headers"; import AuthButtonServer from "./auth-button-server"; import { redirect } from "next/navigation"; import NewTweet from "./new-tweet"; -import Likes from "./likes"; import Tweets from "./tweets"; +export const dynamic = "force-dynamic"; + export default async function Home() { const supabase = createServerComponentClient({ cookies }); diff --git a/20-deploy-next.js-app-router-project-to-production-with-vercel/package-lock.json b/20-deploy-next.js-app-router-project-to-production-with-vercel/package-lock.json index e2fe977..03a4f28 100644 --- a/20-deploy-next.js-app-router-project-to-production-with-vercel/package-lock.json +++ b/20-deploy-next.js-app-router-project-to-production-with-vercel/package-lock.json @@ -22,6 +22,9 @@ "react-dom": "18.2.0", "tailwindcss": "3.3.2", "typescript": "5.1.3" + }, + "devDependencies": { + "encoding": "^0.1.13" } }, "node_modules/@alloc/quick-lru": { @@ -1285,6 +1288,15 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "devOptional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, "node_modules/enhanced-resolve": { "version": "5.15.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", @@ -2297,6 +2309,18 @@ "node": ">=14.18.0" } }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "devOptional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", @@ -3742,6 +3766,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "devOptional": true + }, "node_modules/scheduler": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", diff --git a/20-deploy-next.js-app-router-project-to-production-with-vercel/package.json b/20-deploy-next.js-app-router-project-to-production-with-vercel/package.json index 6186201..a33c273 100644 --- a/20-deploy-next.js-app-router-project-to-production-with-vercel/package.json +++ b/20-deploy-next.js-app-router-project-to-production-with-vercel/package.json @@ -23,5 +23,8 @@ "react-dom": "18.2.0", "tailwindcss": "3.3.2", "typescript": "5.1.3" + }, + "devDependencies": { + "encoding": "^0.1.13" } }