Skip to content

Commit c5377c9

Browse files
committed
Add additional error message and stack trace when a task file cannot be imported for run
1 parent d8006e1 commit c5377c9

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

.changeset/quick-bulldogs-float.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Add additional error message and stack trace when a task file cannot be imported for run

packages/cli-v3/src/entryPoints/deploy-run-worker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ const zodIpc = new ZodIpcConnection({
219219
error: {
220220
type: "INTERNAL_ERROR",
221221
code: TaskRunErrorCodes.COULD_NOT_FIND_TASK,
222+
message: `Could not find task ${execution.task.id}. Make sure the task is exported and the ID is correct.`,
222223
},
223224
usage: {
224225
durationMs: 0,
@@ -248,6 +249,8 @@ const zodIpc = new ZodIpcConnection({
248249
error: {
249250
type: "INTERNAL_ERROR",
250251
code: TaskRunErrorCodes.COULD_NOT_IMPORT_TASK,
252+
message: err instanceof Error ? err.message : String(err),
253+
stackTrace: err instanceof Error ? err.stack : undefined,
251254
},
252255
usage: {
253256
durationMs: 0,

packages/cli-v3/src/entryPoints/dev-run-worker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ const zodIpc = new ZodIpcConnection({
219219
error: {
220220
type: "INTERNAL_ERROR",
221221
code: TaskRunErrorCodes.COULD_NOT_IMPORT_TASK,
222+
message: err instanceof Error ? err.message : String(err),
223+
stackTrace: err instanceof Error ? err.stack : undefined,
222224
},
223225
usage: {
224226
durationMs: 0,

packages/cli-v3/src/indexing/indexWorkerManifest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export async function indexWorkerManifest({
4949
OTEL_IMPORT_HOOK_EXCLUDES: otelHookExclude?.join(","),
5050
TRIGGER_BUILD_MANIFEST_PATH: buildManifestPath,
5151
NODE_OPTIONS: nodeOptions,
52+
TRIGGER_INDEXING: "1",
5253
},
5354
execPath: execPathForRuntime(runtime),
5455
});

0 commit comments

Comments
 (0)