Skip to content

Turbopack doesn't have loadModule on the loader interface #78693

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

Open
Mad-Kat opened this issue Apr 30, 2025 · 0 comments
Open

Turbopack doesn't have loadModule on the loader interface #78693

Mad-Kat opened this issue Apr 30, 2025 · 0 comments
Labels
Turbopack Related to Turbopack with Next.js.

Comments

@Mad-Kat
Copy link

Mad-Kat commented Apr 30, 2025

Link to the code that reproduces this issue

https://github.com/Mad-Kat/turbopack-load-module

To Reproduce

  1. Clone this repo
  2. Build with Turbopack:
npm run build:turbo
# or
yarn build:turbo
# or
pnpm build:turbo
# or
bun build:turbo
  1. The loader will throw an error when processing CSS modules because loadModule is undefined in the Turbopack loader context. If you run the same command with build instead of build:turbo, the loader will work as expected.

Current vs. Expected behavior

Expected Behavior

The loadModule method should be available in the Turbopack loader interface, just as it is in webpack loaders.

Actual Behavior

When running under Turbopack, this.loadModule is undefined, causing the loader to throw an error.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.4.0: Fri Apr 11 18:32:50 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 14
Binaries:
  Node: 22.15.0
  npm: 10.9.2
  Yarn: 4.9.1
  pnpm: 10.2.1
Relevant Packages:
  next: 15.4.0-canary.15 // Latest available version is detected (15.4.0-canary.15).
  eslint-config-next: 15.4.0-canary.15
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

Works correctly with webpack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant