Update prompt loops on every run (0.1.2020 → 0.1.2021): bundled version is stale because build runs before `pver release`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 18
- Forks
- 91
- Avg merge
- 31m
- Merged PRs (30d)
- 349
Description
Summary
Every run of tsci (e.g. tsci init) on the current latest release shows:
A new version of tsci is available (0.1.2020 → 0.1.2021).
Would you like to update now?
Accepting runs npm install -g tscircuit@latest (or the bun equivalent), which reinstalls the exact same version, and the prompt appears again on the next run. There is no way to satisfy the check.
Same symptom as the old #155, but with a different and reproducible root cause this time.
Environment
tscircuit@0.0.2465(npmlatest), which depends on@tscircuit/cli@^0.1.2021@tscircuit/cli@0.1.2021(npmlatest)- Linux, Node v22.23.0 and Bun 1.2.14 — reproduces under both runtimes
Root cause
currentCliVersion() in lib/shared/check-for-cli-update.ts is:
export const currentCliVersion = () =>
program?.version() ?? semver.inc(pkgVersion, "patch") ?? pkgVersion
where pkgVersion is imported from package.json and therefore inlined into dist/cli/main.js at build time. The +1 patch assumes the published version is always exactly one patch above the committed package.json version.
That assumption breaks because .github/workflows/bun-pver-release.yml runs bun run build before pver release bumps the version, and the committed package.json has fallen behind:
| Source | Version |
|---|---|
package.json in main (last bump PR merged: #4510, 2026-08-27) |
0.1.2019 |
var version = "…" inlined in the published dist/cli/main.js |
0.1.2019 |
What the CLI reports for itself (0.1.2019 + 1 patch) |
0.1.2020 |
package.json shipped on disk in @tscircuit/cli@0.1.2021 |
0.1.2021 |
https://registry.npmjs.org/@tscircuit/cli/latest |
0.1.2021 |
So semver.gt("0.1.2021", "0.1.2020") is true forever for this build, and tsci --version --verbose prints @tscircuit/cli: 0.1.2020 even though the installed package is 0.1.2021.
Verified locally:
$ grep '"version"' node_modules/tscircuit/node_modules/@tscircuit/cli/package.json
"version": "0.1.2021",
$ grep -n -m1 'var version = ' node_modules/tscircuit/node_modules/@tscircuit/cli/dist/cli/main.js
136147:var version = "0.1.2019";
$ tsci --version --verbose
tscircuit: 0.0.2465
@tscircuit/cli: 0.1.2020
Why the gap widened (and why no fix has shipped)
The version-bump PRs stopped merging after v0.1.2019, and the Publish to npm workflow has been failing on every push to main since (e.g. run 34154102423 on 2026-09-07). pver release starts from package.json (0.1.2019), finds tags 0.1.2020 … 0.1.2030 already taken, and aborts:
current version: 0.1.2019
candidate next version: 0.1.2020
Next version already exists as a git tag: 0.1.2020. Incrementing version by an increment.
…
Error: Next version already exists as a git tag: 0.1.2030. We tried to incremenet 10 times but the tag still exists. Consider deleting some git tags.
Git tags exist up to v0.1.2030 but npm stops at 0.1.2021, so nothing has been published since, and every user on tscircuit@latest is stuck in the update loop.
Suggested fixes
- Stop guessing the version. Read
require("@tscircuit/cli/package.json").versionat runtime (the on-disk file is correct: 0.1.2021) instead of inliningpackage.jsonand adding a patch. Alternatively, runbun run buildafterpver releasebumpspackage.json, so the inlined value is right. - Unblock the release pipeline: either bump
package.jsoninmainpast0.1.2030or delete the orphan tagsv0.1.2022–v0.1.2030, and look into why the auto-merge ofversion-bumps/**PRs stopped after #4510. - Minor: the check compares against
@tscircuit/cli@latestbut installstscircuit@latest. Iftscircuithas not yet been republished with the newer CLI, "updating" is a no-op and the prompt persists. Comparing againsttscircuit@latest's pinned CLI version would avoid that.
Workaround for users
export TSCI_SKIP_CLI_UPDATE=true
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/shared/check-for-cli-update.ts and inspect how currentCliVersion() gets its package version in the built dist/cli/main.js. Then read .github/workflows/bun-pver-release.yml to trace the build and version-bump order. Done means the installed CLI reports its shipped version and no longer repeats the update prompt after updating.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- build-system, ci-cd, cli, release
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100