Skip to content

fix(patches): drop runtime semver dependency from update service - #40

Merged
sbs44 merged 1 commit into
mainfrom
fix/update-service-semver
Aug 8, 2026
Merged

fix(patches): drop runtime semver dependency from update service#40
sbs44 merged 1 commit into
mainfrom
fix/update-service-semver

Conversation

@sbs44

@sbs44 sbs44 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Release 1.132.05295 crashes at startup with:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'semver' imported from .../app/out/main.js

Root cause: 11-update-use-github-release.patch imports semver in abstractUpdateService.ts for a single semver.compareBuild() call. Upstream 1.132.0 removed semver from its production dependency tree, and since we disable esbuild bundling, the packaged main process resolves bare imports from the shipped node_modules at runtime — where the package no longer exists. The import previously worked only incidentally (semver was a transitive production dep).

Fix: replace the call with a local dotted-numeric comparator in the patch. The compared strings are normalized x.y.z release versions, so no prerelease/build-metadata semantics are needed.

Audited all patches for the same bug class (bare package imports added to src/): the rest are node: builtins or packages the patches themselves add to dependencies (@vscodium/native-keymap, @vscodium/policy-watcher).

Verified: full 36-patch dry-apply passes and src/tsconfig.json typechecks clean (tsgo) on the patched tree.

After merge, a new release needs a manual dispatch (gh workflow run cron-build-and-release.yml -f force_build=true) since the versions pin already matches the latest upstream tag.

The packaged app crashed at startup with ERR_MODULE_NOT_FOUND: upstream
1.132.0 removed semver from its production dependency tree, and with esbuild
bundling disabled the main process resolves bare imports from the shipped
node_modules at runtime. Replace the single semver.compareBuild() call in
_isLatestVersion with a local dotted-numeric comparator (the compared strings
are normalized x.y.z release versions; no prerelease/build-metadata handling
needed).

Audited all patches for other bare package imports into src/ — the remaining
ones are node: builtins or packages the patches add to dependencies
(@vscodium/native-keymap, @vscodium/policy-watcher).
@bradford-tech bradford-tech deleted a comment from claude Bot Aug 8, 2026
@sbs44
sbs44 merged commit 046b004 into main Aug 8, 2026
1 of 3 checks passed
@sbs44
sbs44 deleted the fix/update-service-semver branch August 8, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant