fix(patches): drop runtime semver dependency from update service - #40
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release 1.132.05295 crashes at startup with:
Root cause:
11-update-use-github-release.patchimportssemverinabstractUpdateService.tsfor a singlesemver.compareBuild()call. Upstream 1.132.0 removedsemverfrom its production dependency tree, and since we disable esbuild bundling, the packaged main process resolves bare imports from the shippednode_modulesat 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.zrelease 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 arenode:builtins or packages the patches themselves add todependencies(@vscodium/native-keymap,@vscodium/policy-watcher).Verified: full 36-patch dry-apply passes and
src/tsconfig.jsontypechecks 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.