Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand missing next.config error message #85

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Log a detailed error on the console and exist the process if we canno…
…t find the next config file
shashankboosi committed Oct 10, 2024

Verified

This commit was signed with the committer’s verified signature.
unfor19 Meir Gabay
commit f9cd2e377f4a43da6c22086206d4d3b932926134
5 changes: 4 additions & 1 deletion packages/cloudflare/src/cli/index.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,10 @@ console.log(`Building the Next.js app in the current folder (${nextAppDir})`);

if (!["js", "cjs", "mjs", "ts"].some((ext) => existsSync(`./next.config.${ext}`))) {
// TODO: we can add more validation later
throw new Error("Error: Not in a Next.js app project");
console.error(
"Error: next.config file not found. Please make sure you run the command inside a Next.js app"
);
process.exit(1);
}

const { skipBuild, outputDir } = getArgs();