bun
bun copied to clipboard
Bun reinstalls dependencies with `11.0.0-rc.485` style semver on every install
What version of Bun is running?
1.1.26+0a37423ba
What platform is your computer?
Darwin 23.5.0 arm64 arm
What steps can reproduce the bug?
Add these dependencies to your package.json.
{
"name": "bun-test",
"module": "index.ts",
"type": "module",
"dependencies": {
"@trpc/client": "11.0.0-rc.485",
"@trpc/react-query": "11.0.0-rc.485",
"@trpc/server": "11.0.0-rc.485"
},
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5.0.0"
}
}
Run bun i. Notice that it will install the dependencies.
Run bun i again. Notice it will install them again.
What is the expected behavior?
It should only install once and then when running bun i again it will not re-install them.
What do you see instead?
It continuously re-installs those 3 dependencies.
~/projects/bun-test
❯ bun i
bun install v1.1.26 (0a37423b)
+ @trpc/[email protected]
+ @trpc/[email protected]
+ @trpc/[email protected]
10 packages installed [237.00ms]
~/projects/bun-test
❯ bun i
bun install v1.1.26 (0a37423b)
+ @trpc/[email protected]
+ @trpc/[email protected]
+ @trpc/[email protected]
3 packages installed [31.00ms]
~/projects/bun-test
❯ bun i
bun install v1.1.26 (0a37423b)
+ @trpc/[email protected]
+ @trpc/[email protected]
+ @trpc/[email protected]
3 packages installed [29.00ms]
Additional information
No response
@trpc/(server/client/react-query) are published with version 11.0.0-rc.485, but the package.json in the tarball also includes a build tag in the version, 11.0.0-rc.485+1c1d824cd. This difference causes this bug because bun is byte comparing the expected version (version from root package.json) with the received version (version in node_modules/@trpc/client/package.json). Instead, we should order the version strings as semver, or exclude build tags from the byte comparison.