NextJS dynamicIO - ClerkProvider causing build failure when dynamic routes are used #4921
Open
4 tasks done
Labels
needs-triage
A ticket that needs to be triaged by a team member
Preliminary Checks
I have reviewed the documentation: https://clerk.com/docs
I have searched for existing issues: https://github.com/clerk/javascript/issues
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction
https://github.com/andrewkucz/clerk-dynamic-io-issue
Publishable key
pk_test_c3VwcmVtZS1kb2xwaGluLTI2LmNsZXJrLmFjY291bnRzLmRldiQ
Description
Steps to reproduce:
Expected behavior:
Successful build
Actual behavior:
Hello,
I know dynamicIO is still in canary so I may be early and this may be low prio but couldn't find any reports of this and was frustrated so made a minimal repro to figure out the source lol. I am getting the above error when using dynamic routes with a ClerkProvider despite adding
loading.tsx
's everywhere and many different combinations of"use cache;"
, cacheLifes, and Suspense.I was able to narrow down the issue to the combination of the use of
ClerkProvider
with the use of a dynamic route (in this casesrc/app/test-route/[dynamic]/page.tsx
). Having both seems to cause the build to fail in the way above, even ifauth()
is not called anywhere and the middleware is not in place (the issue still occurs when both are present)If you delete the
ClerkProvider
from the main layout.tsx file, the build will work, OR if you delete thesrc/app/test-route/[dynamic]
folder so that there is no dynamic routes then the build will also pass. I also tried thedynamic
prop to no avail.Thanks!
Environment
The text was updated successfully, but these errors were encountered: