Skip to content

Commit dd9f320

Browse files
authored
fix(ci): pin rolldown binding version to match checked-out source (#597)
## Summary - Pin the rolldown binding version in `download-rolldown-binaries` action to match the checked-out source, instead of fetching the latest from npm - Remove the `VITE_TEST_BUILD=1 vp run tests-e2e#test` line from VitePress E2E (fix in follow-up #599) ## Background on the VitePress `VITE_TEST_BUILD=1` failure There is a bug in vite's `ModuleRunner.directRequest()` where `dynamicRequest` uses the raw `url` parameter for relative path resolution (`posixResolve(posixDirname(url), dep)`). When a module is loaded via a `file://` URL (e.g. VitePress's `import(pathToFileURL(entryPath).href)`), `pathe.resolve` doesn't recognize `file://` as absolute, producing malformed paths like `<cwd>/file:<path>`. ### Why it doesn't happen with vanilla vitest With vanilla vitest, VitePress is a regular npm dependency living in `node_modules/`. Vitest's externalization check (`id.includes('/node_modules/')`) returns `true`, so VitePress is **externalized** — loaded via native Node.js `import()` which handles `file://` URLs correctly. The module runner's `dynamicRequest` is never involved. In vite-plus's ecosystem-ci, VitePress is a `workspace:*` dependency. Its files aren't in `node_modules/`, so it's **inlined** (SSR-transformed). Its `import(pathToFileURL(...))` becomes `__vite_ssr_dynamic_import__('file://...')`, which flows through `dynamicRequest` and hits the bug. ### Why it didn't fail before #588 Before #588, `vp test` commands had caching enabled. When CI ran `vp run tests-e2e#test` (without `VITE_TEST_BUILD`), it succeeded and created a cache entry. The next step `VITE_TEST_BUILD=1 vp run tests-e2e#test` ignored `VITE_TEST_BUILD` since it wasn't in the fingerprinted envs, hit the cache, and `vp test` never actually ran with `VITE_TEST_BUILD=1`. #588 disabled caching on `vp test` commands, so the second step actually ran for the first time and exposed the bug. The fix is in follow-up #599.
1 parent dca0482 commit dd9f320

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/actions/download-rolldown-binaries/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@ runs:
2828
export TARGET="darwin-arm64"
2929
fi
3030
31-
export VERSION=$(npm view --json rolldown | jq -r '.version')
31+
# Pin to the version from checked-out rolldown source to avoid mismatch
32+
# between JS code (built from source) and native binary (downloaded from npm).
33+
# Falls back to npm latest only when rolldown source isn't cloned yet
34+
# (e.g., the standalone download-previous-rolldown-binaries job).
35+
if [ -f "./rolldown/packages/rolldown/package.json" ]; then
36+
export VERSION=$(node -p "require('./rolldown/packages/rolldown/package.json').version")
37+
echo "Using rolldown version from source: ${VERSION}"
38+
else
39+
export VERSION=$(npm view --json rolldown | jq -r '.version')
40+
echo "Warning: rolldown source not found, using npm latest: ${VERSION}"
41+
fi
3242
npm pack "@rolldown/binding-${TARGET}@${VERSION}"
3343
tar -xzf "rolldown-binding-${TARGET}-${VERSION}.tgz"
3444
if [ -d "./rolldown/packages/rolldown/src" ]; then

.github/workflows/e2e-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ jobs:
212212
vp run build
213213
vp test run -r __tests__/unit
214214
vp run tests-e2e#test
215-
VITE_TEST_BUILD=1 vp run tests-e2e#test
216215
vp run tests-init#test
217216
- name: tanstack-start-helloworld
218217
node-version: 24

0 commit comments

Comments
 (0)