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
Notice that the lockfile updates itself due to tsdown's dependency on rolldown
What is expected?
The lockfile does not update itself
What is actually happening?
The lockfile is updated because tsdown depends on rolldown via latest instead of a semver ^1.0.0-beta.X, causing the installation to always pull in the latest rolldown and updates the lockfile when there's a new version of rolldown.
I don't know if this is possibly a bug in pnpm where it should always reuse the locked version, but it might be better to use a strict range in the library instead.
Any additional comments?
This seem to happen since 8ae720a. On npm, you can also see that package.json dependencies has "rolldown": "latest"
This issue cannot be resolved before Rolldown releases an official version: we are unable to restrict pre-releases using semver. In Yarn, specifying ^1.0.0-beta.30 will always install 1.0.0-beta.9, because version comparison is done based on ASCII values.
In Yarn, specifying ^1.0.0-beta.30 will always install 1.0.0-beta.9, because version comparison is done based on ASCII values.
That's strange. Following https://semver.npmjs.com, that should never happen though so it seems more like a yarn bug to me. Do you know if there's a yarn issue to follow?
FWIW I checked the npm source code and the logic that picks 1.0.0-beta.30 (whichever latest) instead seems to be coming from here. For pnpm, I think it's here (tricky to test so just reading the code).
I've added a comment to the rolldown issue if they're willing to unpublished the -commit versions to resolve this. Otherwise, I can report the install issue to pnpm instead as it doesn't happen with npm.
Oh my, what is happening there - parsing semver loose. I wonder what the grammer for 'loose' semver is...and why it's even necessary? Is it to parse partial semvers? Either way, it's evidently being used incorrectly if npm is not pulling .beta.9-commit instead of .beta.30
Perhaps this is a semver bug - one would imagine that given a valid semver string, the loose parse should be identical to the strict parse.
edit: nope, even with loose parsing semver correctly interprets .beta.9-commit.
Oh my, what is happening there - parsing semver loose. I wonder what the grammer for 'loose' semver is...and why it's even necessary? Is it to parse partial semvers? Either way, it's evidently being used incorrectly if npm is not pulling .beta.9-commit instead of .beta.30
It's not really loose that's causing the issue here. It's that npm goes "let's take the latest-tag version (1.0.0-beta.30) and see if it matches with the current specified range (^1.0.0-beta.0). it does? great let's use it" instead of doing the normal semver comparison across all versions.
This is affecting us quite randomly, all of a sudden our builds are failing likely by a bug in the newest version of rolldown which is implicitely installed (even though our versions are pinned). Is there a workaround for this until the rolldown team fixes this?
You can use overrides to set a specific version, or patch the package to use a specific version I think. If you're using pnpm, I think partly it's also a bug in pnpm not making the lockfile idempotent but I haven't had the time to report it yet.
Activity
sxzz commentedon Sep 18, 2025
This issue cannot be resolved before Rolldown releases an official version: we are unable to restrict pre-releases using semver. In Yarn, specifying
^1.0.0-beta.30will always install1.0.0-beta.9, because version comparison is done based on ASCII values.bluwy commentedon Sep 18, 2025
That's strange. Following https://semver.npmjs.com, that should never happen though so it seems more like a yarn bug to me. Do you know if there's a yarn issue to follow?
sxzz commentedon Sep 18, 2025
See https://x.com/sanxiaozhizi/status/1954917986344788299
bluwy commentedon Sep 18, 2025
Thanks, that's interesting. I'm still inclined though that the constraint check in yarn and https://jubianchi.github.io/semver-check/#/^1.0.0-beta.30/1.0.0-beta.9 are incorrect, and https://semver.npmjs.com should be trusted instead since we're dealing with the npm ecosystem.
It would be nice to use a stricter ^ range like before to fix the issue, but that's my opinion.
sxzz commentedon Sep 18, 2025
Since I don't use Yarn, I haven't looked into the reasons behind this behavior or any related issues.
mrginglymus commentedon Sep 18, 2025
I just tested this and
yarn add -D rolldown@^1.0.0-beta.30installs1.0.0-beta.9-commit.d91dfb5This is correct according to semver, as the post-
betasegment of my request is30, but the installed package segment is9-commit.semver says that
Should the beta perhaps have been published as
1.0.0-beta.9+commit.d91dfb5bluwy commentedon Sep 22, 2025
FWIW I checked the npm source code and the logic that picks
1.0.0-beta.30(whichever latest) instead seems to be coming from here. For pnpm, I think it's here (tricky to test so just reading the code).I've added a comment to the rolldown issue if they're willing to unpublished the
-commitversions to resolve this. Otherwise, I can report the install issue to pnpm instead as it doesn't happen with npm.mrginglymus commentedon Sep 22, 2025
Oh my, what is happening there - parsing semver loose. I wonder what the grammer for 'loose' semver is...and why it's even necessary? Is it to parse partial semvers? Either way, it's evidently being used incorrectly if npm is not pulling
.beta.9-commitinstead of.beta.30Perhaps this is a semver bug - one would imagine that given a valid semver string, the loose parse should be identical to the strict parse.
edit: nope, even with loose parsing semver correctly interprets
.beta.9-commit.sxzz commentedon Sep 24, 2025
I wonder if deprecating the
-commitversion would resolve the issue. Unpublishing might be risky for the Rolldown team.bluwy commentedon Sep 24, 2025
It's not really
loosethat's causing the issue here. It's that npm goes "let's take the latest-tag version (1.0.0-beta.30) and see if it matches with the current specified range (^1.0.0-beta.0). it does? great let's use it" instead of doing the normal semver comparison across all versions.mrginglymus commentedon Sep 24, 2025
I guess that's an efficient short circuit for the 99% use case...just happens to be wrong for the 1% - or surprising at best.
Hugos68 commentedon Sep 30, 2025
This is affecting us quite randomly, all of a sudden our builds are failing likely by a bug in the newest version of rolldown which is implicitely installed (even though our versions are pinned). Is there a workaround for this until the rolldown team fixes this?
bluwy commentedon Oct 1, 2025
You can use overrides to set a specific version, or patch the package to use a specific version I think. If you're using pnpm, I think partly it's also a bug in pnpm not making the lockfile idempotent but I haven't had the time to report it yet.
Hugos68 commentedon Oct 1, 2025
Pinning it did the trick through pnpm overrides, thanks @bluwy
sxzz commentedon Oct 20, 2025
The Rolldown API still appears to be unstable, so we’ve decided to pin its version.