Next.js Discord

Discord Forum

Error when using NextJS 16.0.1 + Clerk Provider with cache components

Answered
tommmc. posted this in #help-forum
Open in Discord
I just cloned the clerk/next-auth-starter-template and added cacheComponents in a next.config.ts file and hit errors during build and prerendering.

Any guidance or pointers would be appreciated.
Answered by Morelet’s Crocodile
View full answer

3 Replies

Morelet’s Crocodile
Answer
Morelet’s Crocodile
you'll also have to move your provider inside the html and body
<html>
  <body>
    <ClerkProvider>
      {children}
    </ClerkProvider>
  </body>
</html>
Once it is merged and shipped updating the package will fix it or you can use:
 npm i https://pkg.pr.new/@clerk/nextjs@7119