Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next15 + Turbo dev cause instantiated because it was required from module but the module factory is not available.It might have been deleted in an HMR update. #74167

Open
arvinxx opened this issue Dec 20, 2024 · 0 comments
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.

Comments

@arvinxx
Copy link

arvinxx commented Dec 20, 2024

Link to the code that reproduces this issue

https://github.com/arvinxx/antd-next-cssvar

To Reproduce

just git clone and npm run dev. then open /.

Current vs. Expected behavior

if run using next dev --turbo, it will case instantiated error.

Error: Module [project]/node_modules/.pnpm/[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/react/jsx-dev-runtime.js [app-client] (ecmascript) was instantiated because it was required from module [project]/app/Theme.tsx [app-client] (ecmascript), but the module factory is not available. It might have been deleted in an HMR update.
    at instantiateModule (http://localhost:3000/_next/static/chunks/_26785d._.js:650:15)
    at getOrInstantiateModuleFromParent (http://localhost:3000/_next/static/chunks/_26785d._.js:624:12)
    at esmImport (http://localhost:3000/_next/static/chunks/_26785d._.js:142:20)
    at [project]/app/Theme.tsx [app-client] (ecmascript) (http://localhost:3000/_next/static/chunks/app_c03c0b._.js:67:308)
    at http://localhost:3000/_next/static/chunks/_26785d._.js:693:27
    at runModuleExecutionHooks (http://localhost:3000/_next/static/chunks/_26785d._.js:738:9)
    at instantiateModule (http://localhost:3000/_next/static/chunks/_26785d._.js:691:9)
    at getOrInstantiateModuleFromParent (http://localhost:3000/_next/static/chunks/_26785d._.js:624:12)
    at commonJsRequire (http://localhost:3000/_next/static/chunks/_26785d._.js:157:20)
    at requireModule (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_79b2d4._.js:2676:29)
    at initializeModuleChunk (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_79b2d4._.js:3218:25)
    at readChunk (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_79b2d4._.js:3123:17)
    at react-stack-bottom-frame (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_react-dom_f83a73._.js:13468:20)
    at beginWork (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_react-dom_f83a73._.js:5343:77)
    at runWithFiberInDEV (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_react-dom_f83a73._.js:631:20)
    at performUnitOfWork (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_react-dom_f83a73._.js:7955:97)
    at workLoopConcurrent (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_react-dom_f83a73._.js:7951:58)
    at renderRootConcurrent (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_react-dom_f83a73._.js:7933:71)
    at performWorkOnRoot (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_react-dom_f83a73._.js:7565:175)
    at performWorkOnRootViaSchedulerTask (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_react-dom_f83a73._.js:8394:9)
    at MessagePort.performWorkUntilDeadline (http://localhost:3000/_next/static/chunks/2a6fd_next_dist_compiled_79b2d4._.js:2353:64)

but if this project is run on webpack mode (next dev), it will run correctly.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 22.12.0
  npm: 10.9.0
  Yarn: N/A
  pnpm: 9.4.0
Relevant Packages:
  next: 15.1.2 // Latest available version is detected (15.1.2).
  eslint-config-next: 15.1.2
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
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 have tested 15.1.1-canary.14. It's still failed.

@arvinxx arvinxx added the bug Issue was opened via the bug report template. label Dec 20, 2024
@github-actions github-actions bot added Developer Experience Issues related to Next.js logs, Error overlay, etc. Turbopack Related to Turbopack with Next.js. labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant