Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"dependencies": {
"@fontsource/pretendard": "^5.2.5",
"@radix-ui/react-slot": "^1.2.3",
"@supabase/supabase-js": "^2.75.0",
"@tanstack/react-query": "^5.90.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
Expand Down
150 changes: 150 additions & 0 deletions pnpm-lock.yaml

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

27 changes: 27 additions & 0 deletions src/app/_debug/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// app/debug/page.tsx
"use client";

import { supabase } from "@/app/lab/supabaseClient";
import { useEffect, useState } from "react";

export default function DebugPage() {
const [state, setState] = useState<{ hasSession: boolean; error: unknown }>({
hasSession: false,
error: null,
});

useEffect(() => {
(async () => {
const { data, error } = await supabase.auth.getSession();
setState({ hasSession: !!data.session, error });
})();

// ์„ธ์…˜ ๋ณ€ํ™”๋„ ๊ฐ™์ด ๋กœ๊ทธ
const { data: sub } = supabase.auth.onAuthStateChange((_evt, session) => {
setState({ hasSession: !!session, error: null });
});
return () => sub.subscription.unsubscribe();
}, []);

return <pre style={{ whiteSpace: "pre-wrap" }}>{JSON.stringify(state, null, 2)}</pre>;
}
7 changes: 7 additions & 0 deletions src/app/lab/supabaseClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// lab/supabaseClient.ts
import { createClient } from "@supabase/supabase-js";

export const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
);
Comment on lines +1 to +7

Choose a reason for hiding this comment

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

P1 Badge Declare Supabase client module as client-safe

The new debug page is a Client Component ("use client") but it imports supabase from app/lab/supabaseClient.ts. Files in the app tree are treated as Server Component modules unless they opt in to the client runtime. Because supabaseClient.ts lacks a "use client" directive (or lives outside the app tree), Next.js will throw โ€œCannot import a Server Component into a Client Componentโ€ during build and the page will never compile. Move the client helper outside app/ or mark the file with "use client" before creating the client instance.

Useful? React with ๐Ÿ‘ย / ๐Ÿ‘Ž.