-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Dev server not working when using @next/mdx
with plugins and --turbo
#71819
Comments
Also replicable via https://tailwindui.com/templates/spotlight
|
I'm having the same issue with Next 15.0.1 |
passing const withMDX = createMDX({
options: {
remarkPlugins: [remarkGfm],
rehypePlugins: [rehypeSlug],
},
}); |
Experiencing same issues as OP. const withMDX = createMDX({
// Add markdown plugins here, as desired
options: {
remarkPlugins: [remarkGfm],
rehypePlugins: [],
},
});
var nextConfig = withAxiom(withMDX(config));
|
Also hitting this. Works fine without Removing rehype plugins allows it to run |
This comment has been minimized.
This comment has been minimized.
Chiming in that I have this same issue on version 15.0.2, with the same reproductions as others |
MDX plugins are JavaScript functions which can't be transferred into Turbopack (given it's not JS), we'll have to add something like For now you can remove |
This comment has been minimized.
This comment has been minimized.
This has now been documented in the Next.js docs - in the remark and rehype plugins section: |
@timneutkens thanks for the implementation of MDX plugins in Turbopack (remark, rehype, recma plugins)! I see it was released in I opened a new PR documenting the new capabilities of using plugins via the string name config over here: |
Followup to #72241 and #72467 Documenting the new Turbopack support for MDX plugins (remark, rehype, recma plugins): - #71819 (comment) <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> ### What? Clarify that MDX-related plugins (remark and rehype plugins) are supported when options are serializable, by using the new string name config format ### Why? Support was added in 72802 - #72802 ### How? Add a new section about using plugins with Turbopack
So what's the solution? Why it's closed? I can't use plugins with --turbopack, so I have to remove it. Because this makes MDX unusable in Next.js. |
@bdrtsky I think maybe you missed reading my comment above fully? It's now possible to use remark/rehype/recma plugins with Turbopack. My PR linked above added documentation for that, at the "Using Plugins with Turbopack" docs section here: |
@bdrtsky It's not released yet outside of canary, so you'll have to wait or use the canary version to use remark/rehype plugins with |
Implements support for passing MDX related plugins as strings instead of as JS functions, this makes sure you can use MDX plugins with Turbopack. This still means that e.g. the options have to be serializable, in testing a few plugins these plugins usually have serializable options though. Fixes #71819 Fixes PACK-3345 <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
Followup to #72241 and #72467 Documenting the new Turbopack support for MDX plugins (remark, rehype, recma plugins): - #71819 (comment) <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> ### What? Clarify that MDX-related plugins (remark and rehype plugins) are supported when options are serializable, by using the new string name config format ### Why? Support was added in 72802 - #72802 ### How? Add a new section about using plugins with Turbopack
Link to the code that reproduces this issue
https://github.com/carloscuesta/next-mdx-turbo-plugins-issue
To Reproduce
Current vs. Expected behavior
I'm expecting that the dev server starts normally however the process ends with the following error:
The error doesn't happen when I remove the plugin that I'm passing into the
withMDX
function:❌ Error:
pnpm run dev --turbopack
✅ No error:
pnpm run dev --turbopack
✅ No error:
pnpm run dev
(without turbo flag)Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.0.0: Tue Sep 24 23:39:07 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6000 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 20.14.0 npm: 10.7.0 Yarn: N/A pnpm: 9.12.2 Relevant Packages: next: 15.0.1 // Latest available version is detected (15.0.1). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: N/A Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Markdown (MDX), Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: