FIX: dont crash on startup on Node versions without std - #4098
Open
scott-huberty wants to merge 2 commits into
Open
scott-huberty wants to merge 2 commits into
scott-huberty wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: ba46744 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Author
|
I did not include a regression test.. Perhaps running the tests on a CI with Node |
This branch has not been deployed
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.
Requirement or Bug
#4097
Bug Reproduction Steps
Root Cause
Node added
zlib.createZstdDecompressinv23.8.0and backported it tov22.15.0(LTS). So every22.xfrom22.15on has it, but23.0–23.7don't. The package's engines (>=22.19.0) still accepts 23.0–23.7:kimi-code/apps/kimi-code/package.json
Line 115 in 21406fb
by the looks of it,apps/kimi-code/src/cli/update/native-stage.ts is meant to handle runtimes without
zstd:kimi-code/apps/kimi-code/src/cli/update/native-stage.ts
Line 498 in 21406fb
But
createZstdDecompressis imported at the top of the file, so on23.0–23.7this causes an error..Code Changes
Replace the named import of
createZstdDecompresswith a defaultzlibimport, so a runtime that lacks zstd proceeds through to the existing fallback instead of failing when the module loads.Behavior Changes and Affected Users
kimistartup on Node 23.0–23.7SyntaxErrorChecklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.