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
How are you deploying your application? (if relevant)
No response
Describe the Bug
My blog is powered by Next.js and MDX
Everything works fine on the deployed version. But, when I try visiting a unique slug route locally, I get the error in the image below
Expected Behavior
The slug route should render the unique blog post as expected
To Reproduce
// index page that renders all the blog postsexportdefaultfunctionBlog({ posts }){return(<React.Fragment><Head><title>My blog</title></Head><Container>{posts.map((frontmatter)=>{return<BlogCardkey={frontmatter.slug}data={frontmatter}/>;})}</Container></React.Fragment>);}exportasyncfunctiongetStaticProps(){letarticles=awaitgetAllArticles();constsortedArticles=articles.map((article)=>article);sortedArticles.sort((a,b)=>{returnnewDate(b.publishedAt)-newDate(a.publishedAt);});return{props: {posts: sortedArticles,},};}
// the blog card componentconstBlogCard=({ data })=>{return(<><Linkhref={`/${data.slug}`}passHref><Card><h1className="title">{data.title}</h1><pclassName="summary">{data.excerpt}</p><pclassName="date">{dayjs(data.publishedAt).format("MMMM D, YYYY")} —{" "}{data.readingTime}</p></Card></Link></>);};exportdefaultBlogCard;
The text was updated successfully, but these errors were encountered:
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022
Binaries:
Node: 12.22.9
npm: 8.5.1
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.1.7-canary.0
react: 18.1.0
react-dom: 18.1.0
What browser are you using? (if relevant)
Version 101.0.4951.41 (Official Build) (64-bit)
How are you deploying your application? (if relevant)
No response
Describe the Bug
My blog is powered by Next.js and MDX
Everything works fine on the deployed version. But, when I try visiting a unique slug route locally, I get the error in the image below
Expected Behavior
The slug route should render the unique blog post as expected
To Reproduce
The text was updated successfully, but these errors were encountered: