Next.js Discord

Discord Forum

MDX "frontmatter" | export const meta...

Answered
Golden-winged Warbler posted this in #help-forum
Open in Discord
Golden-winged WarblerOP
In the documentation, the following is mentioned (see image at bottom)

I have the following

"use client"

import Content, {meta} from './content.mdx';

export default function Page() {
  console.log("meta:", meta);
  return <Content />;
}


This works in dev mode, but fails when building

Type error: Module '"*.mdx"' has no exported member 'meta'. Did you mean to use 'import meta from "*.mdx"' instead?

  1 | "use client";
  2 | 
> 3 | import Content, { meta } from "./content.mdx";
    |                   ^
  4 | 
  5 | export default function Page(props: any) {
  6 |   console.log("meta:", meta)


Any insights on how to do this?

1 Reply

Golden-winged WarblerOP
Answer