Skip to content

Commit

Permalink
fix(svelte-scoped): vite dev crash when configured with SSL (#3031)
Browse files Browse the repository at this point in the history
  • Loading branch information
feugy committed Aug 25, 2023
1 parent 29e53de commit 1073bea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/svelte-scoped/src/_vite/global.ts
Expand Up @@ -39,7 +39,7 @@ export function checkTransformPageChunkHook(server: ViteDevServer, isSvelteKit:

res.write = function (chunk, ...rest) {
// eslint-disable-next-line n/prefer-global/buffer
const str = (chunk instanceof Buffer) ? chunk.toString() : ((Array.isArray(chunk) || 'at' in chunk) ? Buffer.from(chunk).toString() : (`${chunk}`))
const str = typeof chunk === 'string' ? chunk : (chunk instanceof Buffer) ? chunk.toString() : ((Array.isArray(chunk) || 'at' in chunk) ? Buffer.from(chunk).toString() : (`${chunk}`))

if (str.includes('<head>') && !str.includes(DEV_GLOBAL_STYLES_DATA_TITLE))
server.config.logger.error(isSvelteKit ? SVELTE_KIT_ERROR : SVELTE_ERROR, { timestamp: true })
Expand Down

0 comments on commit 1073bea

Please sign in to comment.