You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{MDXRemote}from"next-mdx-remote/rsc";import{getAllPostIds,getPost}from"@/lib/post";constcomponents={h2: ({ children }: {children: any})=>{constanchor=`${children.replace(//g,"-").toLowerCase()}`;return(<h2data-sectionid={anchor}>{children}</h2>);}};exportdefaultasyncfunctionBlogPage({
params,}: {params: {slug: string};}){constpost=getPost(params.slug);return(<divclassName="max-h-fit"><MDXRemotecomponents={components}source={post.content}/></div>);}exportasyncfunctiongenerateStaticParams(){constpostIds=awaitgetAllPostIds();returnpostIds;}
the error at build
./app/blog/[slug]/page.tsx:125:16
Type error: 'MDXRemote' cannot be used as a JSX component.
Its return type 'Promise<ReactElement<any, string | JSXElementConstructor<any>>>' is not a valid JSX element.
Type 'Promise<ReactElement<any, string | JSXElementConstructor<any>>>' is missing the following properties from type 'ReactElement<any, any>': type, props, key
There is no problem with the nom run dev
thx
Reproduction
you can try on you self side
next-mdx-remote version
v5.0.0
The text was updated successfully, but these errors were encountered:
Describe the bug
Describe the bug
Failed to build an app
next
with the command :npm run build
the
package.json
the
page.tsx
the error at build
There is no problem with the
nom run dev
thx
Reproduction
you can try on you self side
next-mdx-remote version
v5.0.0
The text was updated successfully, but these errors were encountered: