vercel/next.js

Problem with apollographql using turbopack - Unexpected error processing request: TypeError: module.require is not a function

dincerpece opened this issue · 0 comments

Link to the code that reproduces this issue

https://github.com/dincerpece/nextjs15-1_turbo_apollographql_error

To Reproduce

When I start it with turbopack and open the page, an error occurs.

next dev --port 65000 --turbo

Current vs. Expected behavior

When I run "next dev --port 65000" without turbopack, the response comes as it should. However, when I add the --turbo flag and start it, an error occurs!

Error: Response not successful: Received status code 500
at resolveErrorDev (http://localhost:65000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:3662:65)
at processFullStringRow (http://localhost:65000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:3824:23)
at processFullBinaryRow (http://localhost:65000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:3812:9)
at progress (http://localhost:65000/_next/static/chunks/node_modules_next_dist_compiled_107ce8._.js:3932:102)

nextjs_turbopack_apollographqlerror

nextjs_turbopack_apollographqlerror2

And the warning I mentioned earlier keeps popping up during build!
#72525
nextjs_turbopack_apollographqlerror3

When I run next dev --port 65000 without turbopack, the response comes as it should and works without any problems.
nextjs_apollographql1
nextjs_apollographql2

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32607
  Available CPU cores: 16
Binaries:
  Node: 23.4.0
  npm: 10.9.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.1.0 // Latest available version is detected (15.1.0).
  eslint-config-next: 15.0.3
  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)

Turbopack

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

next dev (local), next build (local)

Additional context

I am running it locally. I want to use my application with turbopack and get fast response. A powerful framework like apollographql needs to be supported by turbopack. @trevor-scheer, @martinnabhan