diff --git a/.changeset/purple-mirrors-smile.md b/.changeset/purple-mirrors-smile.md new file mode 100644 index 000000000..879c45058 --- /dev/null +++ b/.changeset/purple-mirrors-smile.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix edge case where Astro component would render [Object object] when using MDX diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts index 9a655d380..150937a9d 100644 --- a/packages/astro/src/runtime/server/index.ts +++ b/packages/astro/src/runtime/server/index.ts @@ -752,7 +752,7 @@ export async function renderToString( let html = ''; for await (const chunk of renderAstroComponent(Component)) { - html += chunk; + html += stringifyChunk(result, chunk); } return html; }