NextJs+Turbo+ClerkJs+HMR causes Module was instantiated ... but ... is not available. It might have been deleted in an HMR update. #70424
Labels
bug
Issue was opened via the bug report template.
Developer Experience
Issues related to Next.js logs, Error overlay, etc.
Turbopack
Related to Turbopack with Next.js.
Link to the code that reproduces this issue
https://github.com/richardasymmetric/next-clerk-hmr-error
To Reproduce
Sorry for the convoluted reproduction, I'm actually not sure which project (nextjs or clerkjs or turbopack) that I should be reporting this to. I have previously encountered this issue but wasn't sure what caused it since it was a large project, but I started a fresh project today and ran into this issue once I'd added clerkjs into the project, and so it will require a clerk key to run the reproduction.
cp .env.development.local.sample .env.development.local
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
andCLERK_SECRET_KEY
yarn dev
I usually reproducing by editing code, but haven't found a consistent way to trigger it. It's a real show stopper for me when using
--turbo
and I've had to stop using it for the last few months because of this issue.Current vs. Expected behavior
Expected behaviour: the hmr reloads and continues as expected
Actual behaviour:
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 2 20:41:06 UTC 2024 Available memory (MB): 32038 Available CPU cores: 16 Binaries: Node: 20.17.0 npm: Yarn: N/A pnpm: N/A Relevant Packages: next: 14.2.13 // Latest available version is detected (14.2.13). eslint-config-next: 14.2.13 react: 18.3.1 react-dom: 18.3.1 typescript: 5.5.4 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Developer Experience, Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I can reproduce this in next@15.0.0-canary.166
My current hypothesis for this is that there might be multiple versions of either react or next via dependencies, but I'm not certain
The text was updated successfully, but these errors were encountered: