Skip to content

Commit

Permalink
throw if no package manager is detected
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz committed Sep 30, 2024
1 parent 2d3f941 commit e4798f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cloudflare/src/cli/build/build-next-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import { execSync } from "node:child_process";
export async function buildNextjsApp(nextAppDir: string): Promise<void> {
const pm = await detect();

runNextBuildCommand(pm?.name ?? "npm", nextAppDir);
if (!pm) {
throw new Error("Fatal Error: package manager detection failed, aborting");
}

runNextBuildCommand(pm.name, nextAppDir);
}

// equivalent to: https://github.com/sst/open-next/blob/f61b0e94/packages/open-next/src/build.ts#L175-L186
Expand Down

0 comments on commit e4798f0

Please sign in to comment.