fix(ci): switch tsdown config-loader from tsx to unrun#349
Merged
Conversation
tsx 4.22.0 upgraded its bundled esbuild to 0.28, which broke node:* builtin resolution in tsx's loader hooks — specifiers like `node:child_process?tsx-namespace=...` are now read as files and fail with ENOENT. This breaks `packages/core`'s `tsdown --config-loader=tsx` build because the config's `build:before`/`build:done` hooks dynamically import `.ts` files that use Node builtins. Add tsx to overrides so transitive peer-dep resolutions don't pull 4.22.0 back in via vite/vitepress/tsdown. Drop pin when tsx#756 ships. Refs: privatenumber/tsx#750
The previous tsx pin to ~4.21.0 was a false fix. The bug exists in tsx 4.21.x too — it surfaces on Node 24.15.0 (CI's lts/*) but not 24.12.0. tsx's loader hook appends `?tsx-namespace=<timestamp>` to specifiers and Node 24.15.0 then attempts a readFileSync on `node:child_process?...`, failing with ENOENT. Switch tsdown's --config-loader from `tsx` to `unrun` in core and the three example plugins. unrun handles the config and the build:before / build:done hooks' dynamic `.ts` imports without going through tsx's loader hook. Revert the catalog tsx pin and override added in the previous commit since they no longer carry weight.
commit: |
The 0.2.3 bump from `chore: update deps` (d8efd10) made the build fail first via the tsx loader bug — once that was unblocked by switching to the unrun config loader, 86 typecheck errors surfaced. Every `declare module '@vitejs/devtools-kit'` augmentation in kit/core (registering RPC server functions, client functions, and shared-state keys) stopped merging into the re-exported `DevToolsRpc*` interfaces, leaving them as the empty base from devframe/types. Pin the catalog and submodule back to 0.2.2 to restore the green state on commit 3085997. The devframe-side cause needs investigating upstream; revisit when 0.2.4+ ships.
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.
Description
CI on
mainhas been failing sinced8efd109 chore: update deps. Two independent regressions stack on top of each other; both have to be fixed for CI to go green.1. tsx config-loader → unrun.
packages/core's build invokestsdown --config-loader=tsx. On Node 24.15.0 (CI'slts/*), tsx's loader appends?tsx-namespace=<timestamp>to module specifiers and Node 24.15.0 thenreadFileSyncsnode:child_process?tsx-namespace=..., failing with ENOENT. Reproduces on tsx 4.21.1 and 4.22.0 alike — it's a tsx-vs-Node-24.15.0 interop issue, not a tsx-version-specific bug. Local Node 24.12.0 doesn't trip it. Switching to--config-loader=unruninpackages/coreand the three example plugins routes around the broken hook while still handling the config'sbuild:before/build:donedynamic.tsimports.2. devframe
^0.2.3→0.2.2. Unblocking the build surfaced 86 typecheck errors. Everydeclare module '@vitejs/devtools-kit'augmentation in kit/core (registering RPC server/client functions and shared-state keys) stops merging into the re-exportedDevToolsRpc*interfaces under devframe 0.2.3, leaving them as empty bases. Reverting the catalog and submodule pin to 0.2.2 restores the green typecheck observed on commit30859972.Linked Issues
Upstream tsx tracking: privatenumber/tsx#750
Additional context
The first push on this branch pinned tsx to
~4.21.0— that was a false fix, since the tsx bug isn't version-dependent. The follow-up commits replace it with the loader switch plus the devframe revert. Verified locally on Node 24.15.0:pnpm build,pnpm test(190/190),pnpm typecheck(0 errors), andpnpm lintall green. The devframe-side cause should be investigated upstream; revisit when 0.2.4+ ships.