Unverified Commit c110dfd5 authored by Yangshun Tay's avatar Yangshun Tay Committed by GitHub

fix: exclude 'mdx-bundler' from being bundled in server components (#46992)

`mdx-bundler` is used for server-side transformation of MDX files and currently using it within server components will throw a `Module parse failed: Unexpected token` error.

Adding `serverComponentsExternalPackages: ['mdx-bundler']` to `next.config.js` fixes the issue, but it's probably good to add to the default exclusion list as `mdx-bundler` is a relatively popular approach for using MDX in Next.js apps.
parent 74891fde
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"jest", "jest",
"jsdom", "jsdom",
"lodash", "lodash",
"mdx-bundler",
"mongodb", "mongodb",
"next-mdx-remote", "next-mdx-remote",
"next-seo", "next-seo",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment