Fix rendering TextEncoder encoding error regression (#7777)
This commit is contained in:
parent
0c9959704f
commit
3567afac44
2 changed files with 8 additions and 2 deletions
5
.changeset/dry-cycles-appear.md
Normal file
5
.changeset/dry-cycles-appear.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix rendering TextEncoder encoding error regression
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue