Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DynamicServerError #2

Merged
merged 1 commit into from
Oct 7, 2023
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
2 changes: 1 addition & 1 deletion app/account/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default async function Account() {
const { error } = await supabase
.from('users')
.update({ full_name: newName })
.eq('id', user?.id);
.eq('id', user?.id!);
if (error) {
console.log(error);
}
Expand Down
4 changes: 1 addition & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import SupabaseProvider from './supabase-provider';
import Footer from '@/components/ui/Footer';
import Navbar from '@/components/ui/Navbar';
import { PropsWithChildren } from 'react';
import type { Metadata } from 'next'
import 'styles/globals.scss';

const meta = {
Expand All @@ -15,7 +14,7 @@ const meta = {
type: 'website'
};

export const metadata: Metadata = {
export const metadata = {
title: meta.title,
description: meta.description,
cardImage: meta.cardImage,
Expand Down Expand Up @@ -49,7 +48,6 @@ export default function RootLayout({
<html lang="en">
<body className="bg-black loading">
<SupabaseProvider>
{/* @ts-expect-error */}
<Navbar />
<main
id="skip"
Expand Down
7 changes: 4 additions & 3 deletions app/supabase-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { createServerComponentClient } from '@supabase/auth-helpers-nextjs';
import { cookies } from 'next/headers';
import { cache } from 'react';

export const createServerSupabaseClient = cache(() =>
createServerComponentClient<Database>({ cookies })
);
export const createServerSupabaseClient = cache(() => {
const cookieStore = cookies()
return createServerComponentClient({ cookies: () => cookieStore })
})

export async function getSession() {
const supabase = createServerSupabaseClient();
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@supabase/auth-helpers-nextjs": "^0.7.0",
"@supabase/auth-ui-react": "^0.4.2",
"@supabase/auth-ui-shared": "^0.1.6",
"@supabase/supabase-js": "^2.23.0",
"@supabase/supabase-js": "^2.33.2",
"classnames": "^2.3.2",
"@iconify/react": "^4.0.1",
"next": "13.4.3",
Expand Down