Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clerk Instance Not Found

Tags:

next.js

clerk

I've been developing a thread video from JS Mastery and got hit by this error:

- error node_modules\@clerk\shared\dist\esm\hooks\createContextAndHook.js (4:0) @ assertContextExists
- error Error: ClerkInstanceContext not found
null

can anyone help me?

I tried a lot of things but nothing seems to resolve my problem

like image 848
killuaconfessions Avatar asked Aug 02 '26 06:08

killuaconfessions


2 Answers

Have you checked if the <ClerkProvider/> component has been correctly set up in your application? As per the documentation, It is recommended that the <ClerkProvider> wraps the <body> to enable the context to be accessible anywhere within the app.

<ClerkProvider>
  <html lang="en">
    <body className={inter.className}>{children}</body>
  </html>
</ClerkProvider>
like image 130
user17978165 Avatar answered Aug 05 '26 14:08

user17978165


Turns out i was also facing the same issue and as the user "user17978165" has mentioned above haed to app/root/layout.tsx and update the code to

<ClerkProvider>
 <html lang="en">
   <body className={inter.className}>
     <Topbar/>
       <main>
         <LeftSidebar/>
           <section className='main-container'>
             <div className="w-full max-w-4xl">
              {children}
             </div>
           </section>
         <RightSidebar/>
       </main>
     <Bottombar/>
   </body>
 </html>
</ClerkProvider>
like image 41
bablu1921 Avatar answered Aug 05 '26 12:08

bablu1921



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!