-
Notifications
You must be signed in to change notification settings - Fork 75
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
Component loading fails in Next.js 14.2. #228
Comments
I am getting the exact same error since 14.2. When I import components into my MDX file that use
Are there any news on this? |
No one paid any attention. |
There is a new update on this issue. This does not cause all Mdx elements to fail; it only occurs for components imported using an To use the latest Next.js and Mdx-bundler together, the problem is solved by using a temporarily globally created Mdx. However, improvements are needed because the | fyi: ModCodeBlock and Callout can be imported globally in the following way. "use client";
import { CodeBlock, ModCodeBlock } from "@/components/code-block";
import Callout from "@/components/callout";
import "@/styles/mdx.css";
import { getMDXComponent } from "mdx-bundler/client";
export default function PostContent({ code }: any) {
const Component = getMDXComponent(code);
return (
<Component
components={{
code: ({ children, className }: any) => {
const match = /language-(\w+)/.exec(className || "");
const language = match ? match[1] : "";
return <CodeBlock language={language} code={children} />;
},
ModCodeBlock,
Callout,
}}
/>
);
} |
+1 |
I don't know if it's a problem with this library or the changes in nextjs. We will update if there is any missing information.
To explain the error exactly, after the version of nextjs was updated to 14.2, an error occurred when trying to build an mdx poster that includes component rendering.
thank you
mdx-bundler
version:^10.0.2
node
version:v20.11.0
npm
version:10.3.0
, but i use pnpm8.15.6
What you did: All dependencies were upgraded to the latest using pnpm upgrade --latest. It was built later.
What happened: The build was not successful. This was the same even after changing the eslint version to
^8.0.0
.Reproduction repository: https://github.com/minpeter/minpeter.xyz
content/2023-11-21-mdx 블로그 컴포넌트 실험/mdx-blog-test.mdx
post fileThe text was updated successfully, but these errors were encountered: