Skip to content

Commit d2ceb82

Browse files
authored
Fix issue where a typescript file with only types causes indexing to fail (#1735)
* Fix issue where a typescript file with only types causes indexing to fail * Create ninety-cars-peel.md
1 parent 376a0c5 commit d2ceb82

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/ninety-cars-peel.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Fix issue where a typescript file with only types causes indexing to fail

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

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ async function tryImport(path: string): Promise<Result<any>> {
6262
function getExportNames(module: any) {
6363
const exports: string[] = [];
6464

65+
if (!module) {
66+
return exports;
67+
}
68+
6569
const exportKeys = Object.keys(module);
6670

6771
if (exportKeys.length === 0) {

0 commit comments

Comments
 (0)