Convert HTMLString to regular string, preventing hydration script fro… (#4932)

* Convert HTMLString to regular string, preventing hydration script from being missing

* Add a changeset
This commit is contained in:
Matthew Phillips 2022-09-30 19:25:22 -04:00 committed by GitHub
parent f9261ddd00
commit 9898088c0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Prevent hydration mismatch in streaming SSR

View file

@ -69,7 +69,7 @@ export class HTMLParts {
}
toArrayBuffer() {
this.parts.forEach((part, i) => {
if (typeof part === 'string') {
if(!ArrayBuffer.isView(part)) {
this.parts[i] = encoder.encode(String(part));
}
});