clerk / clerk-next-app-router-starter

Get Started with Clerk and Next.js App Router
https://clerk-next-app-router-starter.clerkpreview.com
8 stars 2 forks source link

TypeError: ctx is undefined #3

Closed salmansheri closed 1 year ago

salmansheri commented 1 year ago

clerk terminal

i am getting this error in my project please help me solve it

yasyaindra commented 1 year ago

Make sure to wrap html and body in <ClerkProvider>

    <ClerkProvider>
      <html lang="en">
        <body className={inter.className}>{children}</body>
      </html>
    </ClerkProvider>

at layout.tsx

magnusriga commented 1 year ago

I am getting the same error when trying to access the sign-in route. I already wrapped the app in ClerkProvider. Any idea @yasyaindra ?

magnusriga commented 1 year ago

I fixed it. My issue was related to what you said @yasyaindra . I had wrapped a lower-level route with the ClerkProvider. If others experience a similar issue, try to move the provider right outside the html tag in the outermost layout.js.

LekoArts commented 1 year ago

I'm closing this as it's a user error and not a bug inside this repository.