threads icon indicating copy to clipboard operation
threads copied to clipboard

Error: ClerkInstanceContext not found

Open Uchiha-Itachi0 opened this issue 1 year ago • 9 comments

I am getting this error when I create a sign-in and sign-out page at 25:43 in the video. Can anyone tell me what I am doing wrong

Uchiha-Itachi0 avatar Aug 10 '23 12:08 Uchiha-Itachi0

I think you haven't wrapped the HTML inside <ClerkProvider> that is why you got this error: Solution Demo: https://stackoverflow.com/questions/76844096/clerk-instance-not-found

hempun10 avatar Aug 10 '23 13:08 hempun10

Just wrap your html with <ClerkProvider> in both of auth & root layout..

<ClerkProvider> <html lang="en">...</html> </ClerkProvider>

anggihnurh avatar Aug 11 '23 00:08 anggihnurh

Worked for me!, thanks !

Bagrianow avatar Aug 11 '23 09:08 Bagrianow

For some reason if I wrap both the sign-in page doesn't pop up for me, page just goes all black. Desktop Screenshot 2023 08 17 - 14 27 18 33 Desktop Screenshot 2023 08 17 - 14 27 12 74 Desktop Screenshot 2023 08 17 - 14 30 46 93

tpratt57 avatar Aug 17 '23 19:08 tpratt57

did you install clerk? npm install @clerk/nextjs

AymanBoumait avatar Aug 18 '23 17:08 AymanBoumait

silly mistake on my part. Put the sign-in tsx file in the sign-up and vice versa

tpratt57 avatar Aug 18 '23 17:08 tpratt57

well now you fixed it, good job

AymanBoumait avatar Aug 18 '23 17:08 AymanBoumait

great. thanks!

Whillian-Sousa avatar Nov 05 '23 01:11 Whillian-Sousa

app > (auth) > layout.tsx > RootLayout For the solution, you need to wrap a ClerkProvider in the RootLayout method:

export default function RootLayout({ 
    children 
}: { 
    children: React.ReactNode 
}) {
    return (
        <ClerkProvider>
            <html lang="en">
                <body className={`${inter.className} bg-dark-1`}>
                    {children}
                </body>
            </html>
        </ClerkProvider>
    )
}

erciktiburak avatar Jan 16 '24 18:01 erciktiburak