File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
2222import { prettyWarning } from "./utilities/cliOutput.js" ;
2323import type { InstrumentationModuleDefinition } from "@opentelemetry/instrumentation" ;
2424import { builtinModules } from "node:module" ;
25+ import { OutroCommandError } from "./cli/common.js" ;
2526
2627export type ResolveConfigOptions = {
2728 cwd ?: string ;
@@ -162,6 +163,23 @@ async function resolveConfig(
162163 ? dirname ( packageJsonPath )
163164 : cwd ;
164165
166+ // `trigger.config` is the fallback value set by c12
167+ const missingConfigFile = ! result . configFile || result . configFile === "trigger.config" ;
168+
169+ if ( missingConfigFile ) {
170+ const err = new OutroCommandError (
171+ [
172+ "Couldn't find your trigger.config.ts file." ,
173+ "" ,
174+ "Make sure you are in the directory of your Trigger.dev project, or specify the path to your config file using the `--config <path>` flag." ,
175+ "" ,
176+ "Alternatively, you can initialize a new project using `npx trigger.dev@latest init`." ,
177+ ] . join ( "\n" )
178+ ) ;
179+ err . stack = undefined ;
180+ throw err ;
181+ }
182+
165183 const config =
166184 "config" in result . config ? ( result . config . config as TriggerConfig ) : result . config ;
167185
You can’t perform that action at this time.
0 commit comments