Skip to content

Commit 5e1f25f

Browse files
committed
fix(cli): sort bundle files by entry path for deterministic task attribution
1 parent be45cf9 commit 5e1f25f

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

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+
Fix non-deterministic task-to-file attribution when multiple tasks share an output bundle. `Object.entries` iteration order is not guaranteed, so tasks defined in imported files could be attributed to the wrong source file. Files are now sorted by entry path before registration.

packages/cli-v3/src/build/bundle.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ export async function getBundleResultFromBuild(
307307
}
308308
}
309309

310+
files.sort((a, b) => a.entry.localeCompare(b.entry));
311+
310312
if (!configPath) {
311313
return undefined;
312314
}

0 commit comments

Comments
 (0)