summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.changeset/dry-cycles-appear.md5
-rw-r--r--packages/astro/src/runtime/server/render/common.ts5
2 files changed, 8 insertions, 2 deletions
diff --git a/.changeset/dry-cycles-appear.md b/.changeset/dry-cycles-appear.md
new file mode 100644
index 000000000..574c15665
--- /dev/null
+++ b/.changeset/dry-cycles-appear.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Fix rendering TextEncoder encoding error regression
diff --git a/packages/astro/src/runtime/server/render/common.ts b/packages/astro/src/runtime/server/render/common.ts
index b2d41bd54..206f138cc 100644
--- a/packages/astro/src/runtime/server/render/common.ts
+++ b/packages/astro/src/runtime/server/render/common.ts
@@ -124,7 +124,8 @@ export function chunkToByteArray(
if (ArrayBuffer.isView(chunk)) {
return chunk as Uint8Array;
} else {
- // stringify chunk might return a HTMLString
- return encoder.encode(stringifyChunk(result, chunk));
+ // `stringifyChunk` might return a HTMLString, call `.toString()` to really ensure it's a string
+ const stringified = stringifyChunk(result, chunk);
+ return encoder.encode(stringified.toString());
}
}