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
@sveltejs/package fails to build when package.json dependencies use Bun's workspace catalog syntax (e.g., "svelte": "catalog:svelte"). The tool attempts to parse catalog references as semver ranges, causing a build failure.
Context
Set up a Bun workspace with catalogs in root package.json:
> Invalid comparator: catalog:svelte
at Comparator.parse (/path/to/node_modules/semver/classes/comparator.js:41:13)
at new Comparator (/path/to/node_modules/semver/classes/comparator.js:25:10)
at /path/to/node_modules/semver/classes/range.js:154:47
at Array.map (<anonymous>)
at Range.parseRange (/path/to/node_modules/semver/classes/range.js:154:35)
at /path/to/node_modules/semver/classes/range.js:42:22
at Array.map (<anonymous>)
at new Range (/path/to/node_modules/semver/classes/range.js:42:8)
at Object.intersects (/path/to/node_modules/semver/ranges/intersects.js:5:8)
at emit_dts (file:///path/to/@sveltejs/package/src/typescript.js:31:30)
Additional context
This appears to happen in the TypeScript declaration generation step where @sveltejs/package tries to use the semver library to parse dependency versions. Bun's catalog syntax (catalog:catalog-name) is not a valid semver range.
Current Workaround: Use explicit versions in packages that need @sveltejs/package, manually keeping them in sync with catalog definitions.
> Invalid comparator: catalog:svelte
at Comparator.parse (/path/to/node_modules/semver/classes/comparator.js:41:13)
at new Comparator (/path/to/node_modules/semver/classes/comparator.js:25:10)
at /path/to/node_modules/semver/classes/range.js:154:47
at Array.map (<anonymous>)
at Range.parseRange (/path/to/node_modules/semver/classes/range.js:154:35)
at /path/to/node_modules/semver/classes/range.js:42:22
at Array.map (<anonymous>)
at new Range (/path/to/node_modules/semver/classes/range.js:42:8)
at Object.intersects (/path/to/node_modules/semver/ranges/intersects.js:5:8)
at emit_dts (file:///path/to/@sveltejs/package/src/typescript.js:31:30)
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
@sveltejs/package
fails to build whenpackage.json
dependencies use Bun's workspace catalog syntax (e.g.,"svelte": "catalog:svelte"
). The tool attempts to parse catalog references as semver ranges, causing a build failure.Context
package.json
:@sveltejs/package
with catalog references:bun run build
Expected behavior
@sveltejs/package
should either:Actual behavior
Additional context
This appears to happen in the TypeScript declaration generation step where
@sveltejs/package
tries to use thesemver
library to parse dependency versions. Bun's catalog syntax (catalog:catalog-name
) is not a valid semver range.Current Workaround: Use explicit versions in packages that need
@sveltejs/package
, manually keeping them in sync with catalog definitions.Reproduction
https://github.com/handlebauer/sveltejs-package-bun-catalog-repro
Logs
System Info
Severity
blocking an upgrade
Additional Information
https://x.com/bunjavascript/status/1925074467518353452
The text was updated successfully, but these errors were encountered: