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
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
We were trying to upgrade our astro version from 4 -> 5. We saw some cryptic errors.
Objects are not valid as a React child (found: object with keys {astro:jsx, type, props}). If you meant to render a collection of children, use an array instead.
Hint:
This issue often occurs when your MDX component encounters runtime errors.
We narrowed down this issue to @astrojs/mdx 4.0.4. Which was released yesterday,
When we downgraded to 4.0.3 everything was working well.
Our code in blog/[id].astro
---importBlogLayoutfrom"@/layouts/BlogLayout.astro";importLayoutfrom"@/layouts/Layout.astro";import{getCollection,getEntry,render}from"astro:content";exportasyncfunctiongetStaticPaths(){constallPosts=awaitgetCollection('articles');returnallPosts.map(post=>({params: {id: post.id}}))}// 1. Get the slug from the incoming server requestconst{ id }=Astro.params;if(id===undefined){returnAstro.redirect("/404");}// 2. Query for the entry directly using the request slugconstpost=awaitgetEntry("articles",id);console.log("Post",post)// 3. Redirect if the entry does not existif(post===undefined){returnAstro.redirect("/404");}// 4. Render the entry to HTML in the templateconst{ Content }=awaitrender(post);console.log("Content",Content)---
<!-- Failing here-->
<Content/>
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
We were trying to upgrade our astro version from 4 -> 5. We saw some cryptic errors.
We narrowed down this issue to
@astrojs/mdx
4.0.4. Which was released yesterday,When we downgraded to 4.0.3 everything was working well.
Our code in
blog/[id].astro
What's the expected result?
Blog working
Link to Minimal Reproducible Example
https://github.com/withastro/astro
Participation
The text was updated successfully, but these errors were encountered: