-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Description
When using runtime: 'bun' in trigger.config.ts, the indexing phase crashes with:
TypeError: Column must be greater than or equal to 0, got -1
at SourceMapConsumer_findMapping (source-map/lib/source-map-consumer.js:588:13)
at SourceMapConsumer_originalPositionFor (source-map/lib/source-map-consumer.js:653:17)
at mapSourcePosition (source-map-support/source-map-support.js:244:38)
at wrapCallSite (source-map-support/source-map-support.js:397:9)
at prepareStackTrace (source-map-support/source-map-support.js:446:25)
at registerResources (trigger.dev/src/indexing/registerResources.ts:32:11)
at bootstrap (trigger.dev/src/entryPoints/managed-index-worker.ts:91:37)
This happens because Bun's runtime produces -1 as a column value when resolving stack traces, and source-map@0.6.1 (transitive dep via source-map-support@0.5.21) throws on negative columns.
This is a known Bun issue: oven-sh/bun#8087
Reproduction
- trigger.dev v4.3.3
runtime: 'bun'in trigger.config.ts- A monorepo project with shared modules imported across packages
The error started appearing after a refactoring that introduced new cross-package imports, likely producing source maps that trigger the Bun bug.
Workaround
We patched source-map@0.6.1 via pnpm to clamp -1 columns to 0 instead of throwing:
- throw new TypeError('Column must be greater than or equal to 0, got '
- + aNeedle[aColumnName]);
+ aNeedle[aColumnName] = 0;Suggested fix
Since bun runtime is already marked as experimental, trigger.dev could either:
- Catch and gracefully handle this error in
registerResourcesduring indexing - Pin or patch
source-map-supportto handle invalid column values - Document this as a known bun runtime limitation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels