diff options
Diffstat (limited to 'src/write/build-modes/live-dev-server.js')
-rw-r--r-- | src/write/build-modes/live-dev-server.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js index 42a4ab74..f6eec334 100644 --- a/src/write/build-modes/live-dev-server.js +++ b/src/write/build-modes/live-dev-server.js @@ -321,7 +321,16 @@ export async function go({ 'Content-Length': size, }); - await pipeline(fd.createReadStream(), response); + try { + await pipeline(fd.createReadStream(), response); + } catch (error) { + if (error.code === 'ERR_STREAM_PREMATURE_CLOSE') { + // Connection was dropped, this is OK. + return; + } else { + throw error; + } + } if (loudResponses) console.log(`${requestHead} [200] ${pathname} (${colors.magenta(`web route`)})`); |