diff --git a/.changeset/ninety-cars-peel.md b/.changeset/ninety-cars-peel.md new file mode 100644 index 0000000000..12584b18b3 --- /dev/null +++ b/.changeset/ninety-cars-peel.md @@ -0,0 +1,5 @@ +--- +"trigger.dev": patch +--- + +Fix issue where a typescript file with only types causes indexing to fail diff --git a/packages/cli-v3/src/indexing/registerTasks.ts b/packages/cli-v3/src/indexing/registerTasks.ts index 5e9323ab73..aaa283e0f7 100644 --- a/packages/cli-v3/src/indexing/registerTasks.ts +++ b/packages/cli-v3/src/indexing/registerTasks.ts @@ -62,6 +62,10 @@ async function tryImport(path: string): Promise> { function getExportNames(module: any) { const exports: string[] = []; + if (!module) { + return exports; + } + const exportKeys = Object.keys(module); if (exportKeys.length === 0) {