fix(build): invoke tsx directly via node --import instead of npx#3237
Merged
Conversation
npx resolution breaks when scripts/build.js is invoked under bun (bun's npx wrapper intercepts and runs tsx inside bun's runtime, where tsx's CJS entry fails to resolve). Using 'node --import tsx/esm' skips the npx layer entirely and works under both npm and bun invocation.
wenshao
reviewed
Apr 17, 2026
wenshao
left a comment
Collaborator
There was a problem hiding this comment.
package.json:22
[Suggestion] The public generate:settings-schema script still uses tsx scripts/generate-settings-schema.ts, while this PR updates scripts/build.js to use node --import tsx/esm ... for the same task. That leaves bun run generate:settings-schema on the old execution path, so the bun compatibility issue remains on another entry point.
Suggested fix:
"generate:settings-schema": "node --import tsx/esm scripts/generate-settings-schema.ts",
— gpt-5.4 via Qwen Code /review
…ript Matches the approach taken in scripts/build.js so running `bun run generate:settings-schema` directly bypasses bun's npx wrapper and avoids the `Cannot find module './cjs/index.cjs'` tsx CJS failure. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
wenshao
approved these changes
Apr 18, 2026
wenshao
left a comment
Collaborator
There was a problem hiding this comment.
No issues found. LGTM! ✅ — gpt-5.4 via Qwen Code /review
TaimoorSiddiquiOfficial
pushed a commit
to TaimoorSiddiquiOfficial/HopCode
that referenced
this pull request
Apr 19, 2026
Merged 6 upstream commits while preserving HopCode architecture: Features synced from upstream: - feat(mcp): OSC 52 copy hotkey for OAuth authorization URL (QwenLM#3393) Press 'c' during OAuth to copy URL via terminal clipboard, works over SSH - feat(cli): early input capture to prevent keystroke loss during startup (QwenLM#3319) Buffers keystrokes during REPL init, replays once UI is mounted - perf(vscode): fix input lag in long conversations via React.memo (QwenLM#2550) MessageList/UserMessage/AssistantMessage wrapped with React.memo - feat(vscode-ide-companion): agent execution tool display (QwenLM#2590) Render dedicated agent execution cards in webview - fix(build): invoke tsx via node --import instead of npx (QwenLM#3237) Fixes bun compatibility for generate:settings-schema script - ci(stale): enable 35+35 stale/close PR policy (QwenLM#3375) Conflict resolution: - packages/vscode-ide-companion/.../toolcalls/index.tsx: kept @hoptrendy/webui, added ToolCallData to imports (upstream added it) - All @qwen-code/* import paths preserved as @hoptrendy/* (HopCode arch) - HopCode branding, version, and CI workflows preserved Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
…nLM#3237) * fix(build): invoke tsx directly via node --import instead of npx npx resolution breaks when scripts/build.js is invoked under bun (bun's npx wrapper intercepts and runs tsx inside bun's runtime, where tsx's CJS entry fails to resolve). Using 'node --import tsx/esm' skips the npx layer entirely and works under both npm and bun invocation. * fix(build): use node --import tsx/esm for generate:settings-schema script Matches the approach taken in scripts/build.js so running `bun run generate:settings-schema` directly bypasses bun's npx wrapper and avoids the `Cannot find module './cjs/index.cjs'` tsx CJS failure. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
scripts/build.jscallsexecSync('npx tsx scripts/generate-settings-schema.ts', ...). When the build is invoked under bun (e.g. `bun run build`), bun's `npx` wrapper intercepts the call and runs `tsx` inside bun's runtime, where tsx's CJS entry fails to resolve with:```
error: Cannot find module './cjs/index.cjs' from ''
```
Switching to `node --import tsx/esm` bypasses the npx layer and works identically under npm and bun, since `node` is always a real node binary.
Test plan