Using @mdx-js/react
2.0.0-rc1 inside Next.js
#1766
-
I'm trying to update from So my setup is something like this. I have mdx file (simplified version): import Layout from "layouts/LayoutName";
export const meta = { key: "value" };
export default function Wrapper (props) {
return <Layout {...props} meta={meta} />;
}; And I have layout file (simplified version): import { MDXProvider } from "@mdx-js/react";
const components = {
h1: (props) => { return <h1 {...props} /> }
};
export default function LayoutName ({ children }) {
return <MDXProvider components={components}>{children}</MDXProvider>;
} This code is running on
The problem here from that I understand is that Nextjs didn't compile
Without And I can't find a way how I can replace it with I can probably try to manually push |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 21 replies
-
@iAdramelk if you are using Next.js 11.1 or higher, you may need to enable https://nextjs.org/blog/next-11-1#es-modules-support |
Beta Was this translation helpful? Give feedback.
@iAdramelk if you are using Next.js 11.1 or higher, you may need to enable https://nextjs.org/blog/next-11-1#es-modules-support