We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
next : 14.1.0 next-mdx-remote: 4.4.1
I use custom components so t need to put the component in props in mdxRemote, it works perfectly in development,
the "Result:" is the custom component.
But when deploy start causing issues, and i dont know why ?!
/blog/[post].tsx
import { Frontmatter, HighlightedText, MDXOptions, H1, H2, H3, H4, H5, H6 } from '@/components/mdx' const customComponents = { HighlightedText, h1 : H1, h2 : H2, h3 : H3, h4 : H4, h5 : H5, h6 : H6, } export const getServerSideProps = ( async (context : GetServerSidePropsContext<{post : string}>) => { //context : params, res, req, query, daftMode, resolveUrl const { params, res } = context; res.setHeader( 'Cache-Control', 'public, s-maxage=3600, stale-while-revalidate=3600' ) const { post } = params!; const folder = 'src/pages/blog/posts'; const fileContent = fs.readFileSync(process.cwd() + '/' + folder + '/' + post + '.mdx', 'utf8').trim(); const headings = extractHeadingFromExtractedMDXText(fileContent); const content = await serialize(fileContent, MDXOptions) return { props: { mdxSource : content, Headings: headings }, } }) export default function Post ({mdxSource, Headings} : Props){ return ( <div className='mx-2'> <MDXProvider> <MDXRemote {...mdxSource} components={customComponents}/> </MDXProvider> </div> )}
markdown-101.mdx
<HighlightedText content={`Result:`} />
the HighlightedText component:
export function HighlightedText(props) { const { content } = props; return <span>{content}</span> }
The text was updated successfully, but these errors were encountered:
Can you share what the MDXOptions is ?
MDXOptions
Sorry, something went wrong.
No branches or pull requests
next : 14.1.0
next-mdx-remote: 4.4.1
I use custom components so t need to put the component in props in mdxRemote, it works perfectly in development,
But when deploy start causing issues, and i dont know why ?!
/blog/[post].tsx
markdown-101.mdx
the HighlightedText component:
The text was updated successfully, but these errors were encountered: