Skip to content

Commit

Permalink
Fix [Object object] in MDX output (#4180)
Browse files Browse the repository at this point in the history
* fix: use stringifyChunk in `renderToString` fn

* chore: add changeset

Co-authored-by: Nate Moore <nate@astro.build>
  • Loading branch information
natemoo-re and natemoo-re authored Aug 5, 2022
1 parent c9b679e commit c56a922
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/purple-mirrors-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix edge case where Astro component would render [Object object] when using MDX
2 changes: 1 addition & 1 deletion packages/astro/src/runtime/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c56a922

Please sign in to comment.