vercel / next.js

The React Framework
https://nextjs.org
MIT License
124.84k stars 26.65k forks source link

@next/mdx not compatible with --turbo #67453

Closed goatyeahh closed 1 day ago

goatyeahh commented 2 months ago

Link to the code that reproduces this issue

https://github.com/goatyeahh/next-mdx-turbo-bug

To Reproduce

  1. Start the app
  2. Go to "/"

Current vs. Expected behavior

⨯ Error: Expected process result to be a module, but it was ignored

Debug info:

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 20.13.1
  npm: 10.5.2
  Yarn: 1.22.19
  pnpm: 9.4.0
Relevant Packages:
  next: 14.2.4 // Latest available version is detected (14.2.4).
  eslint-config-next: 14.2.4
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.5.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

No response

ywwa commented 3 weeks ago

works when you add following to next.config.js

  experimental: {
    mdxRs: true,
  },
samcx commented 1 day ago

The above comment is true—you need to be using the experimental flag if you want to use this with --turbo.

https://nextjs.org/docs/app/building-your-application/configuring/mdx#using-the-rust-based-mdx-compiler-experimental

CleanShot 2024-09-10 at 16 21 00@2x

The team has been made aware of this! We should definitely add a better error message in there.

I will be marking this as closed since it does work with the experimental flag.

lauri865 commented 23 hours ago

But it doesn't really allow any of the previous configuration of @next/mdx, does it @samcx? E.g. adding remark/rehype plugins.

samcx commented 3 hours ago

But it doesn't really allow any of the previous configuration of @next/mdx, does it @samcx? E.g. adding remark/rehype plugins.

@lauri865 I have not actually tried (it is experimental) yet. Curious if this is what you've experienced :frog-eyes: