Skip to content

Commit

Permalink
Handle next build error
Browse files Browse the repository at this point in the history
  • Loading branch information
fwang committed Apr 6, 2023
1 parent 32bc062 commit e5b5204
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/many-fans-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"open-next": patch
---

Handle `next build` error
17 changes: 12 additions & 5 deletions packages/open-next/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,18 @@ function setStandaloneBuildMode() {
}

function buildNextjsApp(packager: "npm" | "yarn" | "pnpm") {
cp.spawnSync(packager, packager === "npm" ? ["run", "build"] : ["build"], {
stdio: "inherit",
cwd: appPath,
shell: true,
});
const result = cp.spawnSync(
packager,
packager === "npm" ? ["run", "build"] : ["build"],
{
stdio: "inherit",
cwd: appPath,
shell: true,
}
);
if (result.status && result.status !== 0) {
process.exit(1);
}
}

function printHeader(header: string) {
Expand Down

1 comment on commit e5b5204

@vercel
Copy link

@vercel vercel bot commented on e5b5204 Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

open-next – ./

open-next-sst-dev.vercel.app
open-next-git-main-sst-dev.vercel.app
open-next.vercel.app

Please sign in to comment.