Skip to content

Commit

Permalink
exit with exit status 1 on build unexpected errors (when watch mode i…
Browse files Browse the repository at this point in the history
…s disabled) (#754)
  • Loading branch information
juanferreras authored Apr 22, 2024
1 parent 5170477 commit 446e9af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-owls-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cloudflare/next-on-pages': patch
---

exit with exit status 1 on build unexpected errors (when watch mode is disabled)
3 changes: 3 additions & 0 deletions packages/next-on-pages/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ function runBuild(options: CliOptions) {
const errorMessage =
error instanceof Error ? error.message : JSON.stringify(error);
cliError(`Unexpected error: ${errorMessage}`);
if (!options.watch) {
process.exit(1);
}
});
}

Expand Down

0 comments on commit 446e9af

Please sign in to comment.