Skip to content

Commit

Permalink
fix(dev): stop remix dev when esbuild is not running (#7158)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori authored Aug 14, 2023
1 parent 7a9ed0b commit d81df18
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-bananas-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

stop remix dev when esbuild is not running
12 changes: 12 additions & 0 deletions packages/remix-dev/compiler/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ export async function watch(
let compiler = await Compiler.create(ctx);
let compile = () =>
compiler.compile({ onManifest: onBuildManifest }).catch((thrown) => {
if (
thrown instanceof Error &&
thrown.message === "The service is no longer running"
) {
ctx.logger.error("esbuild is no longer running", {
details: [
"Most likely, your machine ran out of memory and killed the esbuild process",
"that `remix dev` relies on for builds and rebuilds.",
],
});
process.exit(1);
}
logThrown(thrown);
return undefined;
});
Expand Down

0 comments on commit d81df18

Please sign in to comment.