Skip to content

Commit

Permalink
fix(ssr): Properly decoding unit8array streamed writes for HTML minif…
Browse files Browse the repository at this point in the history
…ication
  • Loading branch information
leomp12 committed Oct 23, 2024
1 parent b1e73e0 commit b5472fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ssr/src/lib/serve-storefront.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ export default async (req: Request, res: Response) => {
const [chunk] = args;
if (outputHtml !== null) {
try {
const html = chunk.toString();
const html = typeof chunk === 'string' || Buffer.isBuffer(chunk)
? chunk.toString()
: new TextDecoder().decode(chunk);
if (html) outputHtml += html;
} catch {
outputHtml = null;
Expand Down

0 comments on commit b5472fc

Please sign in to comment.