Skip to content

fix(cli): share Vite runtime through the core alias - #2617

Merged
fengmk2 merged 9 commits into
mainfrom
fix/vite-core-module-identity
Sep 7, 2026
Merged

fix(cli): share Vite runtime through the core alias#2617
fengmk2 merged 9 commits into
mainfrom
fix/vite-core-module-identity

Conversation

@fengmk2

@fengmk2 fengmk2 commented Sep 6, 2026

Copy link
Copy Markdown
Member

TanStack Start can return HTTP 404 when the CLI and plugins load separate core copies. The CLI now uses the exact vite alias for its dependency, runtime imports, and generated exports.

Version checks use the installed CLI manifest and the command's target project. They reject incompatible declared dependencies and permit incidental hoisted peers. The public config types retain test when Vitest resolves a separate Vite copy.

Preview packing and CI tarball installation preserve the alias. Version checks also support packages whose versions change after the build. The design is in rfcs/vite-core-module-identity.md.

Fixes #1391.

@netlify

netlify Bot commented Sep 6, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 61a012f
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a9eaa10f794cb000839117c

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 6, 2026

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-vite-core-module-identity-viteplus-dev.voidzero-docs.workers.dev (commit 61a012f)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://afe3a183-viteplus-dev.voidzero-docs.workers.dev 61a012f 2026-09-07T12:13:03.047Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://7259e27c-viteplus-dev.voidzero-docs.workers.dev 6a8070a 2026-09-07T08:50:56.511Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://948ced1d-viteplus-dev.voidzero-docs.workers.dev 15cc57f 2026-09-07T07:33:52.688Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9dbae347-viteplus-dev.voidzero-docs.workers.dev b26ca76 2026-09-07T05:24:13.638Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ac578ee3-viteplus-dev.voidzero-docs.workers.dev 4ae9445 2026-09-07T03:46:42.993Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://d349dea2-viteplus-dev.voidzero-docs.workers.dev 025d9f1 2026-09-06T16:00:41.305Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://b4724b1d-viteplus-dev.voidzero-docs.workers.dev b1c17ad 2026-09-06T15:45:46.225Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://486ca84f-viteplus-dev.voidzero-docs.workers.dev 38ca5e4 2026-09-06T15:13:59.763Z Visit the dashboard ↗

@fengmk2 fengmk2 self-assigned this Sep 6, 2026
@fengmk2 fengmk2 added the preview-build Publish this PR's commits to the registry bridge as preview builds label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

CLI artifact sizes (61a012f)

Final release artifacts built by the canonical build-upstream and build-windows-cli actions.
The dist rows use the Linux build. The core total excludes .node files to match the release artifact.

Artifact Format Base PR Change
packages/cli/dist Directory total 2.13 MiB 2.14 MiB +867 B (+0.04%)
packages/core/dist Directory total 3.92 MiB 3.92 MiB 0 B (0.00%)
Combined package dist Directory total 6.05 MiB 6.06 MiB +867 B (+0.01%)
vp (Linux x64) Binary 10.99 MiB 10.99 MiB 0 B (0.00%)
vp (Linux x64) gzip -9 4.76 MiB 4.76 MiB 0 B (0.00%)
NAPI (Linux x64) Binary 31.93 MiB 31.93 MiB 0 B (0.00%)
NAPI (Linux x64) gzip -9 12.61 MiB 12.61 MiB +1.07 KiB (+0.01%)
vp (macOS ARM64) Binary 8.19 MiB 8.19 MiB 0 B (0.00%)
vp (macOS ARM64) gzip -9 4.15 MiB 4.15 MiB 0 B (0.00%)
NAPI (macOS ARM64) Binary 39.55 MiB 39.55 MiB 0 B (0.00%)
NAPI (macOS ARM64) gzip -9 16.93 MiB 16.93 MiB +52 B (+0.00%)
vp (Windows x64) Binary 8.86 MiB 8.86 MiB 0 B (0.00%)
vp (Windows x64) gzip -9 3.88 MiB 3.88 MiB +1 B (+0.00%)
NAPI (Windows x64) Binary 26.81 MiB 26.81 MiB +2.00 KiB (+0.01%)
NAPI (Windows x64) gzip -9 10.70 MiB 10.70 MiB +2.88 KiB (+0.03%)
Trampoline (Windows x64) Binary 14.00 KiB 14.00 KiB 0 B (0.00%)
Trampoline (Windows x64) gzip -9 7.09 KiB 7.09 KiB 0 B (0.00%)
Installer (Windows x64) Binary 4.50 MiB 4.50 MiB 0 B (0.00%)
Installer (Windows x64) gzip -9 2.11 MiB 2.11 MiB -2 B (-0.00%)

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Registry bridge build (15cc57f)

This commit build is published to the registry bridge, which serves these as ordinary npm versions (every other package proxies to npmjs):

Package Version
vite-plus 0.0.0-commit.15cc57f55e221b26ca82e7475ce90d22af8b5cd0
@voidzero-dev/vite-plus-core 0.0.0-commit.15cc57f55e221b26ca82e7475ce90d22af8b5cd0

Install the Vite+ CLI built from this commit, then migrate a project:

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/voidzero-dev/vite-plus/15cc57f55e221b26ca82e7475ce90d22af8b5cd0/packages/cli/install.sh | VP_PR_VERSION=2617 bash
# Windows (PowerShell)
$env:VP_PR_VERSION="2617"; irm https://raw.githubusercontent.com/voidzero-dev/vite-plus/15cc57f55e221b26ca82e7475ce90d22af8b5cd0/packages/cli/install.ps1 | iex

Or download the standalone Windows installer built from this commit:

Architecture Installer
x64 vp-setup-x86_64-pc-windows-msvc.exe
Arm64 vp-setup-aarch64-pc-windows-msvc.exe

GitHub requires you to sign in and downloads each installer as a ZIP artifact. Extract vp-setup.exe, then run it against this preview build:

.\vp-setup.exe --version "0.0.0-commit.15cc57f55e221b26ca82e7475ce90d22af8b5cd0" --registry "https://registry-bridge.viteplus.dev/"

After installing, upgrade the current project's vite-plus to this test build with:

vp migrate

Or point your package manager at the bridge registry https://registry-bridge.viteplus.dev/:

Package manager Registry config
npm / pnpm / Bun .npmrc: registry=https://registry-bridge.viteplus.dev/
Yarn (v2+) .yarnrc.yml: npmRegistryServer: "https://registry-bridge.viteplus.dev/"

Then pin the build (vite aliases to vite-plus-core; pnpm can use a catalog, npm an overrides entry):

{
  "devDependencies": {
    "vite-plus": "0.0.0-commit.15cc57f55e221b26ca82e7475ce90d22af8b5cd0",
    "vite": "npm:@voidzero-dev/vite-plus-core@0.0.0-commit.15cc57f55e221b26ca82e7475ce90d22af8b5cd0"
  }
}

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

🐳 Docker preview image

Built from this PR's registry bridge build:

Image Compressed size
ghcr.io/voidzero-dev/vite-plus:pr-2617 223MB
# remove any stale local copy from a previous run, then pull fresh
docker rmi ghcr.io/voidzero-dev/vite-plus:pr-2617 2>/dev/null; docker pull ghcr.io/voidzero-dev/vite-plus:pr-2617

Quick check:

docker run --rm ghcr.io/voidzero-dev/vite-plus:pr-2617 vp --version

See docs/guide/docker.md for usage.

@sapphi-red sapphi-red left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cause and the fix makes sense to me

@fengmk2
fengmk2 force-pushed the fix/vite-core-module-identity branch from 4ae9445 to b26ca76 Compare September 7, 2026 05:22
@fengmk2 fengmk2 added preview-build Publish this PR's commits to the registry bridge as preview builds and removed preview-build Publish this PR's commits to the registry bridge as preview builds labels Sep 7, 2026
@fengmk2
fengmk2 force-pushed the fix/vite-core-module-identity branch from b26ca76 to 15cc57f Compare September 7, 2026 07:32
@fengmk2 fengmk2 added preview-build Publish this PR's commits to the registry bridge as preview builds and removed preview-build Publish this PR's commits to the registry bridge as preview builds labels Sep 7, 2026
@fengmk2

fengmk2 commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T12:43:21.077667Z 61a012f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 61a012f008

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2
fengmk2 merged commit 0931d9b into main Sep 7, 2026
128 checks passed
@fengmk2
fengmk2 deleted the fix/vite-core-module-identity branch September 7, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview-build Publish this PR's commits to the registry bridge as preview builds test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: sfw

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TanStack Start SSR broken: dual-copy of vite-plus-core causes isRunnableDevEnvironment() instanceof failure

2 participants