You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: CLI crashes with "Invalid comparator: catalog:" when @trigger.dev/* deps use workspace catalogs (bun/pnpm catalog: protocol) #3905
Running trigger dev (or deploy, preview, workers build — anything that runs the embedded update check) crashes immediately when @trigger.dev/* dependencies in package.json use the catalog: version protocol (bun and pnpm workspace catalogs):
TypeError: Invalid comparator: catalog:
at Comparator.parse (.../semver/classes/comparator.js:41:13)
...
at Module.minVersion (.../semver/ranges/min-version.js:8:11)
at .../trigger.dev/dist/esm/commands/update.js:71:42
Reproduction repo
See Repo Info Below
To reproduce
In a bun (or pnpm) workspace, define a catalog in the root package.json and reference it from the app that runs the CLI:
When the tryResolveTriggerPackageVersion() fallback fails to resolve the installed version from node_modules, the raw "catalog:" string is kept as dep.version and flows into semver.minVersion() in getVersionMismatches(), which throws (it's wrapped in neither a try/catch nor a semver.validRange guard):
(Optionally also harden getVersionMismatches() — e.g. guard the semver.minVersion() call with semver.validRange(dep.version) or a try/catch — so any other non-semver specifier degrades to a warning instead of a crash.)
Note: skipping these specifiers entirely does mean catalog users lose the version-mismatch check. A nicer fix would be to keep relying on tryResolveTriggerPackageVersion() (which already resolves the real installed version) and only skip when resolution fails — but never letting catalog: reach semver is the minimal correct change.
Workaround
trigger dev --skip-update-check (and the same flag on deploy) bypasses the crashing code path.
I've submitted a vouch request (#3993) to work on this. Quick additional finding from tracing the code:
The getVersionMismatches() call at line 116 of update.ts passes dep.version directly to semver.minVersion() without any guard. Even with the catalog: skip, hardening the semver call with a try/catch or a semver.validRange() guard would prevent similar crashes from any future non-semver specifier slipping through. Happy to include that in the PR.
Activity
cschanhniem commentedon Jun 19, 2026
I've submitted a vouch request (#3993) to work on this. Quick additional finding from tracing the code:
The
getVersionMismatches()call at line 116 ofupdate.tspassesdep.versiondirectly tosemver.minVersion()without any guard. Even with thecatalog:skip, hardening the semver call with a try/catch or asemver.validRange()guard would prevent similar crashes from any future non-semver specifier slipping through. Happy to include that in the PR.anishfyi commentedon Aug 31, 2026
I can keep catalog protocol specifiers out of semver parsing while preserving installed-version resolution, and add focused CLI update-check tests.