Skip to content

Commit

Permalink
fix errors in build
Browse files Browse the repository at this point in the history
  • Loading branch information
dijonmusters committed Jul 20, 2023
1 parent bc65068 commit 554ebbf
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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,
}: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Database>({ cookies });
const {
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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<Database>({ cookies });

Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Database>({ cookies });

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
"react-dom": "18.2.0",
"tailwindcss": "3.3.2",
"typescript": "5.1.3"
},
"devDependencies": {
"encoding": "^0.1.13"
}
}

1 comment on commit 554ebbf

@mikoalala
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like I have the same build issues you were likely experiencing without the export const dynamic = "force-dynamic";, however that doesn't seem to fix it for my project!

Please sign in to comment.