fix: sync Node preflight range with package.json engines#854
Merged
Conversation
The bin.ts runtime check still allowed Node >=18.17.0 while engines requires >=22.22.0. npx does not enforce engines, so users on older Node runtimes slipped through the preflight and crashed inside dependencies with cryptic errors instead of getting the upgrade message. Generated-By: PostHog Code Task-Id: 7901cd0a-07f4-4964-ad71-79a3b0c9c146
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
sarahxsanders
approved these changes
Jul 10, 2026
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.
Problem
The runtime Node version check in
bin.tsstill enforces>=18.17.0, whilepackage.jsonengines requires>=22.22.0. npx doesn't enforce engines (it only warns), so users on older Node runtimes pass the preflight and crash later inside dependencies with cryptic errors instead of a clear upgrade message.Reported via wizard@posthog.com: a user on an old Node runtime was routed to the pi harness, whose bundled
undici@8.5.0callsmarkAsUncloneable(added in Node 22.10) at module load — surfacing asAPI Error: webidl.util.markAsUncloneable is not a functionimmediately after login. Present on a small but steady share of pi-harness runs since the experiment started.Changes
NODE_VERSION_RANGEinbin.tsfrom>=18.17.0to>=22.22.0, matchingengines.node, with a comment explaining why the preflight must stay in sync.Known limitation (follow-up candidate): on Node 18 the preflight is unreachable entirely —
dist/bin.jsis ESM, so its static import graph parses before any code runs, andstring-width@8's/vregex flag is a SyntaxError on Node 18's V8. Giving those users a friendly message requires a dependency-free entry wrapper that checks the version before dynamically importing the real bin.Test plan
pnpm build(includes smoke + warlock tests) — passedpnpm vitest run— 96 files, 1305 tests passedpnpm fix— cleanWhy
A support report showed old-Node users hitting an instant, misleading "API Error" right after authentication; the stale preflight is the root cause and this makes it fail fast with a clear upgrade message.
Created with PostHog Code