Last active
April 30, 2024 19:57
-
-
Save devilelephant/a9da0be914fb61b7f7c7233b6825f6c6 to your computer and use it in GitHub Desktop.
Next.js 14 MDX fix when running --turbo dev server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nextMDX from "@next/mdx"; | |
/** @type {import('next').NextConfig} */ | |
const nextConfig = { | |
pageExtensions: ["js", "jsx", "ts", "tsx", "mdx"], | |
experimental: { | |
mdxRs: true | |
}, | |
}; | |
const withMDX = nextMDX({ | |
extension: /\.mdx?$/ | |
}); | |
export default withMDX(nextConfig); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This solves the "Error: not an ecmascript module" error when trying to run MDX on Node.js 14 with the --turbo flag on the dev server.
main fix was the mdxRs:true experimental flag: