Open arbisyarifudin opened 3 months ago
Hi. I think the 404 not found is because i add vercel.json file in there. So i delete it and run the build again and but the result is: https://fsc-sd-web2-git-main-test-arbis-projects-2fa9c352.vercel.app/?_vercel_share=AnHcaMF8drBKWMPKsTwqUI4uAPwHpIpQ
and the logs is:
TypeError: Cannot read properties of undefined (reading 'getSession')
at m (/var/task/.next/server/app/(dynamic-pages)/(main-pages)/page.js:1:6628)
at y (/var/task/.next/server/app/(dynamic-pages)/(main-pages)/page.js:1:6860)
at eh (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134786)
at e (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:137671)
at ek (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:138145)
at Array.toJSON (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135755)
at stringify (<anonymous>)
at eR (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142219)
at eE (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:142698)
at Timeout._onTimeout (/var/task/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:135475) {
digest: '2243357109'
}
the problem is i think from this file: (dynamic-pages)/layout.tsx
import { DynamicLayoutProviders } from './DynamicLayoutProviders';
import { AppSupabaseClient } from '@/types';
import { createSupabaseServerComponentClient } from '@/supabase-clients/createSupabaseServerComponentClient';
// do not cache this layout
export const dynamic = 'force-dynamic';
export const fetchCache = 'only-no-store';
export const revalidate = 0;
async function fetchSession(supabaseClient: AppSupabaseClient) {
// This is a server-side call, so it will not trigger a revalidation
const {
data: { session },
error,
} = await supabaseClient.auth.getSession();
if (error) {
throw error;
}
return session;
}
export const metadata = {
icons: {
icon: '/images/logo-black-main.ico',
},
title: 'Super Day',
description: 'Super Day',
};
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const supabaseClient = createSupabaseServerComponentClient();
const [session] = await Promise.all([fetchSession(supabaseClient)]);
return (
<DynamicLayoutProviders initialSession={session}>
{children}
</DynamicLayoutProviders>
);
}
Hey @arbisyarifudin, did you solve the issue I am getting the same problem recently, I have tried lot of things but none seem to be working.
@imbhargav5 a little help here?
Hi π will look at it first thing tomorrow.
On Thu, 5 Sep 2024 at 12:36β―AM, Ved Nig @.***> wrote:
@imbhargav5 https://github.com/imbhargav5 a little help here?
β Reply to this email directly, view it on GitHub https://github.com/imbhargav5/nextbase-nextjs-supabase-starter/issues/33#issuecomment-2329781709, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWM6RD37V5CEW4J23DDCP3ZU5K4TAVCNFSM6AAAAABLB26CECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRZG44DCNZQHE . You are receiving this because you were mentioned.Message ID: @.*** com>
Any update, are you able to reproduce this?
Hi @vednig @arbisyarifudin I have actually been doing a complete rewrite the past few days. Sorry it took a bit longer, but I removed a few outdated patterns and this new code should fare a lot better.
That's great π , will you be using @supabase/ssr in it? And is there any expected timeline for updates?
I have an app in production, facing this error and I can find a solution to this problem, other than rebuilding it from scratch.
Yes . Already using supabase ssr. But itβs a bit inconsistent now. In about 1-2 weeks everything will be crisp.
On Sun, 8 Sep 2024 at 5:46β―PM, Ved Nig @.***> wrote:
I have an app in production, facing this error and I can find a solution to this problem, other than rebuilding it from scratch.
β Reply to this email directly, view it on GitHub https://github.com/imbhargav5/nextbase-nextjs-supabase-starter/issues/33#issuecomment-2336663889, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWM6RBJ4T5ICSEI4ZY7LJLZVQ5YVAVCNFSM6AAAAABLB26CECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZWGY3DGOBYHE . You are receiving this because you were mentioned.Message ID: @.*** com>
Hi, I use your template and added some pages and functionality. But when it is deployed to Vercel, it's always turned 404.
Please feel free to check this. https://fsc-sd-web2-git-develop-arbis-projects-2fa9c352.vercel.app?_vercel_share=kHsrmA32GvDt0CqRCW35ux0FMt1zTXcG