Skip to content

Commit 425889e

Browse files
authored
Merge pull request #2 from koksing456/bugfix/fix-deployment-issue
Fix DynamicServerError
2 parents 2d6ba1c + 3407870 commit 425889e

5 files changed

Lines changed: 8 additions & 9 deletions

File tree

app/account/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default async function Account() {
4444
const { error } = await supabase
4545
.from('users')
4646
.update({ full_name: newName })
47-
.eq('id', user?.id);
47+
.eq('id', user?.id!);
4848
if (error) {
4949
console.log(error);
5050
}

app/layout.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import SupabaseProvider from './supabase-provider';
22
import Footer from '@/components/ui/Footer';
33
import Navbar from '@/components/ui/Navbar';
44
import { PropsWithChildren } from 'react';
5-
import type { Metadata } from 'next'
65
import 'styles/globals.scss';
76

87
const meta = {
@@ -15,7 +14,7 @@ const meta = {
1514
type: 'website'
1615
};
1716

18-
export const metadata: Metadata = {
17+
export const metadata = {
1918
title: meta.title,
2019
description: meta.description,
2120
cardImage: meta.cardImage,
@@ -49,7 +48,6 @@ export default function RootLayout({
4948
<html lang="en">
5049
<body className="bg-black loading">
5150
<SupabaseProvider>
52-
{/* @ts-expect-error */}
5351
<Navbar />
5452
<main
5553
id="skip"

app/supabase-server.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import { createServerComponentClient } from '@supabase/auth-helpers-nextjs';
33
import { cookies } from 'next/headers';
44
import { cache } from 'react';
55

6-
export const createServerSupabaseClient = cache(() =>
7-
createServerComponentClient<Database>({ cookies })
8-
);
6+
export const createServerSupabaseClient = cache(() => {
7+
const cookieStore = cookies()
8+
return createServerComponentClient({ cookies: () => cookieStore })
9+
})
910

1011
export async function getSession() {
1112
const supabase = createServerSupabaseClient();

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@supabase/auth-helpers-nextjs": "^0.7.0",
1616
"@supabase/auth-ui-react": "^0.4.2",
1717
"@supabase/auth-ui-shared": "^0.1.6",
18-
"@supabase/supabase-js": "^2.23.0",
18+
"@supabase/supabase-js": "^2.33.2",
1919
"classnames": "^2.3.2",
2020
"@iconify/react": "^4.0.1",
2121
"next": "13.4.3",

0 commit comments

Comments
 (0)