Skip to content

fix: unify virtual module handling for Start Vite plugins#7178

Merged
schiller-manuel merged 6 commits intomainfrom
fix-6588
Apr 13, 2026
Merged

fix: unify virtual module handling for Start Vite plugins#7178
schiller-manuel merged 6 commits intomainfrom
fix-6588

Conversation

@schiller-manuel
Copy link
Copy Markdown
Contributor

@schiller-manuel schiller-manuel commented Apr 13, 2026

fixes #6588

Summary by CodeRabbit

  • Bug Fixes

    • Improved virtual-module resolution in pnpm workspaces so the client entry is served reliably.
  • New Features

    • Generates and registers a virtual client entry to ensure correct client bundle wiring.
    • Adds a lightweight release metadata entry for patch publishing.
  • Refactor

    • Centralized and simplified virtual-module handling and consolidated related exports for a cleaner plugin surface.
  • Tests

    • Added tests validating virtual module resolution, id encoding, and client-entry generation.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 02a2b577-bd99-4deb-b504-16cf8468df34

📥 Commits

Reviewing files that changed from the base of the PR and between b4b1172 and b8c884e.

📒 Files selected for processing (1)
  • packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts

📝 Walkthrough

Walkthrough

Adds a shared Vite virtual-module factory (createVirtualModule), migrates multiple Start plugins to use it, introduces a virtual client-entry plugin, updates core exports and consumer type imports, adds tests, and includes a changeset describing virtual-module resolution fixes.

Changes

Cohort / File(s) Summary
New core utility
packages/start-plugin-core/src/vite/createVirtualModule.ts
Adds createVirtualModule factory to standardize Vite virtual-module resolveId/load wiring and escape # in module IDs.
Core plugin migrations
packages/start-plugin-core/src/vite/dev-server-plugin/plugin.ts, packages/start-plugin-core/src/vite/serialization-adapters-plugin.ts, packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts, packages/start-plugin-core/src/vite/start-manifest-plugin/plugin.ts
Replaces inline virtual-module implementations with createVirtualModule, removing bespoke resolve/load filtering and local ID-escaping logic.
Virtual client entry
packages/start-plugin-core/src/vite/plugins.ts, packages/start-plugin-core/src/vite/plugin.ts
Adds createVirtualClientEntryPlugin and registers it to emit a normalized virtual client entry before manifest generation.
Exports & manifest
packages/start-plugin-core/src/index.ts, packages/start-plugin-core/package.json
Exports createVirtualModule and an additional type; removes ./vite/types package subpath export.
Consumer import updates
packages/react-start/src/plugin/vite.ts, packages/react-start-rsc/src/plugin/vite.ts, packages/solid-start/src/plugin/vite.ts, packages/vue-start/src/plugin/vite.ts
Consolidates type-only imports to use root @tanstack/start-plugin-core exports; react-start-rsc now uses shared createVirtualModule.
Tests added
packages/start-plugin-core/tests/createVirtualModule.test.ts, packages/start-plugin-core/tests/virtual-client-entry-plugin.test.ts
Adds Vitest suites validating Vite-prefixed IDs, hash-escaping, and client-entry path normalization.
Changeset metadata
.changeset/rare-pigs-smash.md
Adds changeset describing patch-level release and virtual-module resolution fixes.

Sequence Diagram(s)

sequenceDiagram
    participant Browser as Browser (Client)
    participant Vite as Vite Dev Server
    participant Plugin as Start Plugin Core (createVirtualModule)
    participant Config as ConfigResolver/Entry Planner

    Browser->>Vite: GET /@id/virtual:tanstack-start-client-entry
    Vite->>Plugin: resolveId("virtual:tanstack-start-client-entry")
    Plugin->>Config: getClientEntry()
    Config-->>Plugin: client entry path
    Plugin-->>Vite: resolved id ("\0virtual:tanstack-start-client-entry")
    Vite->>Plugin: load(resolved id)
    Plugin-->>Vite: module source (import "normalized/path/to/client")
    Vite-->>Browser: module source (200)
    Browser->>Vite: dynamic import → hydration
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • lachlancollins

Poem

🐰 I nibbled through symlinks, found a better way,
a tidy virtual gate where requests now play,
hashes tucked safe, paths march straight and true,
Vite hands the entry, hydration hops through,
carrots for tests — a celebratory chew! 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix: unify virtual module handling for Start Vite plugins' accurately describes the main change—consolidating virtual module creation logic into a shared createVirtualModule helper across multiple plugin files.
Linked Issues check ✅ Passed The PR fully addresses issue #6588 by implementing a new shared createVirtualModule helper and a createVirtualClientEntryPlugin that serve the client entry through a real Vite virtual module, resolving symlink issues in pnpm workspaces.
Out of Scope Changes check ✅ Passed All changes are directly scoped to unifying virtual module handling: removing the ./vite/types export path, refactoring existing virtual module implementations to use the shared helper, and consolidating type imports across framework plugins.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-6588

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud bot commented Apr 13, 2026

View your CI Pipeline Execution ↗ for commit b8c884e

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 9m 3s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 30s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-13 20:35:24 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

🚀 Changeset Version Preview

2 package(s) bumped directly, 3 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/react-start-rsc 0.0.15 → 0.0.16 Changeset
@tanstack/start-plugin-core 1.167.32 → 1.167.33 Changeset
@tanstack/react-start 1.167.35 → 1.167.36 Dependent
@tanstack/solid-start 1.167.33 → 1.167.34 Dependent
@tanstack/vue-start 1.167.33 → 1.167.34 Dependent

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Bundle Size Benchmarks

  • Commit: c373feb22b06
  • Measured at: 2026-04-13T20:27:11.366Z
  • Baseline source: history:328d7e5ebc6b
  • Dashboard: bundle-size history
Scenario Current (gzip) Delta vs baseline Raw Brotli Trend
react-router.minimal 87.33 KiB 0 B (0.00%) 274.58 KiB 75.97 KiB ███▇▇▇▇▇▁▁▁
react-router.full 90.59 KiB 0 B (0.00%) 285.66 KiB 78.72 KiB ████████▁▁▁
solid-router.minimal 35.50 KiB 0 B (0.00%) 106.58 KiB 31.88 KiB ███▇▇▇▇▇▁▁▁
solid-router.full 39.98 KiB 0 B (0.00%) 120.08 KiB 35.93 KiB ████████▁▁▁
vue-router.minimal 53.30 KiB 0 B (0.00%) 151.99 KiB 47.86 KiB ████████▁▁▁
vue-router.full 58.19 KiB 0 B (0.00%) 167.41 KiB 52.09 KiB ████████▁▁▁
react-start.minimal 101.73 KiB 0 B (0.00%) 322.31 KiB 87.94 KiB ████████▁▁▁
react-start.full 105.17 KiB 0 B (0.00%) 332.64 KiB 90.84 KiB ███▇▇▇▇▇▁▁▁
solid-start.minimal 49.50 KiB 0 B (0.00%) 152.39 KiB 43.63 KiB ████████▁▁▁
solid-start.full 55.03 KiB 0 B (0.00%) 168.60 KiB 48.41 KiB ████████▁▁▁

Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 13, 2026

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7178

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7178

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7178

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7178

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7178

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7178

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7178

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7178

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7178

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7178

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7178

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7178

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7178

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7178

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7178

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7178

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7178

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7178

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7178

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7178

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7178

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7178

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7178

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7178

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7178

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7178

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7178

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7178

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7178

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7178

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7178

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7178

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7178

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7178

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7178

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7178

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7178

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7178

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7178

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7178

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7178

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7178

commit: b8c884e

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (3)
packages/start-plugin-core/tests/createVirtualModule.test.ts (1)

1-38: LGTM! Good coverage of core virtual module ID resolution behavior.

The tests effectively validate the \0 prefix for Vite virtual modules and the #%23 encoding for hash-prefixed module IDs. The as any casts are acceptable here for accessing plugin internals in test code.

Consider adding edge case tests for non-matching IDs to verify the handler returns undefined:

💡 Optional: Additional edge case test
+  test('returns undefined for non-matching ids', () => {
+    const plugin = createVirtualModule({
+      name: 'test-non-match',
+      moduleId: 'virtual:test-module',
+      load() {
+        return 'export const ok = true'
+      },
+    })
+
+    expect((plugin as any).resolveId.handler('virtual:other-module')).toBeUndefined()
+    expect((plugin as any).load.handler('\0virtual:other-module')).toBeUndefined()
+  })

,

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/start-plugin-core/tests/createVirtualModule.test.ts` around lines 1
- 38, Add an edge-case test in createVirtualModule.test.ts that ensures
resolveId.handler and load.handler return undefined for non-matching IDs: create
another test using a plugin from createVirtualModule (e.g., moduleId
'virtual:test-module' and '#virtual:test-module') and call resolveId.handler and
load.handler with unrelated strings (like 'other-module' and '\0other-module')
asserting they return undefined to validate non-matching behavior.
packages/start-plugin-core/src/vite/createVirtualModule.ts (1)

4-7: Consider using Vite's plugin context type instead of any for better type safety.

The this: any type loses compile-time safety for properties like this.environment, this.error(), etc. that are used in the load handlers throughout this PR.

💡 Optional: Stricter typing using Vite's plugin context
+import type { Plugin, PluginContext } from 'vite'
+
+// Vite's load handler receives a PluginContext-like object with environment info
+interface VirtualModuleLoadContext extends PluginContext {
+  environment: { name: string; mode: string; config: { command: string; consumer?: string } }
+}

 type VirtualModuleLoadHandler = (
-  this: any,
+  this: VirtualModuleLoadContext,
   id: string,
 ) => string | null | undefined | Promise<string | null | undefined>

This is optional since any provides flexibility, but stricter types would catch misuse at compile time.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/start-plugin-core/src/vite/createVirtualModule.ts` around lines 4 -
7, Replace the unsafe this: any in the VirtualModuleLoadHandler type with Vite's
PluginContext to get proper typings for this.environment, this.error, etc.;
import type { PluginContext } from 'vite' and update the type to use that symbol
(e.g., this: PluginContext) so all load handlers using VirtualModuleLoadHandler
gain compile-time safety while preserving behavior.
packages/start-plugin-core/src/vite/plugins.ts (1)

20-22: Remove the redundant .replaceAll('\\', '/') after normalizePath.

Vite's normalizePath already normalizes all path separators to forward slashes. The additional .replaceAll call has no effect and should be removed.

♻️ Suggested simplification
     load() {
-      return `import ${JSON.stringify(normalizePath(opts.getClientEntry()).replaceAll('\\', '/'))}`
+      return `import ${JSON.stringify(normalizePath(opts.getClientEntry()))}`
     },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/start-plugin-core/src/vite/plugins.ts` around lines 20 - 22, The
load() function currently returns a string using
normalizePath(opts.getClientEntry()).replaceAll('\\', '/'); remove the redundant
.replaceAll('\\', '/') because normalizePath already converts backslashes to
forward slashes; update the load() return expression to use only
normalizePath(opts.getClientEntry()) and keep the JSON.stringify wrapping as-is
so the module import path remains correct.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/react-start-rsc/src/plugin/vite.ts`:
- Around line 3-9: Move the inline "type" specifiers out of the mixed import and
into a dedicated top-level type-only import: keep the runtime import for
createVirtualModule from '@tanstack/start-plugin-core' and add a separate
"import type { TanStackStartVitePluginCoreOptions,
ViteRscForwardSsrResolverStrategy } from '@tanstack/start-plugin-core'". Update
references to TanStackStartVitePluginCoreOptions and
ViteRscForwardSsrResolverStrategy accordingly so the file no longer uses "type"
inline specifiers in the mixed import.

In `@packages/react-start/src/plugin/vite.ts`:
- Around line 1-6: The current combined import mixes runtime values and types;
split into a runtime import for START_ENVIRONMENT_NAMES and tanStackStartVite
and a top-level type-only import for TanStackStartViteInputConfig and
TanStackStartVitePluginCoreOptions to satisfy the
import/consistent-type-specifier-style rule. Locate the import that currently
includes START_ENVIRONMENT_NAMES, tanStackStartVite, type
TanStackStartViteInputConfig, and type TanStackStartVitePluginCoreOptions and
change it so runtime symbols (START_ENVIRONMENT_NAMES, tanStackStartVite) are
imported normally and the two types are imported with an "import type" statement
at the top level.

In `@packages/solid-start/src/plugin/vite.ts`:
- Around line 1-6: The import statement mixes value and type specifiers;
separate the type-only imports into an `import type` clause: keep the runtime
values START_ENVIRONMENT_NAMES and tanStackStartVite in the original import from
'@tanstack/start-plugin-core' and move the type names
TanStackStartViteInputConfig and TanStackStartVitePluginCoreOptions into a new
`import type` statement so the code complies with the enforced type-specifier
lint rule.

In `@packages/start-plugin-core/src/vite/serialization-adapters-plugin.ts`:
- Line 18: The load handler's explicit this type annotation (`load(this: {
environment: { name: string } })`) narrows the Vite plugin context and must be
removed; update the `load` function signature in
`serialization-adapters-plugin.ts` to omit the `this` type (i.e., `load(...) {
... }`) so it uses the full Vite plugin `this` context used by
`createVirtualModule` and `opts.load.call(this, id)`—do not replace it with a
stricter custom type.

In `@packages/vue-start/src/plugin/vite.ts`:
- Around line 1-6: Move the two type-only imports into a top-level "import type"
statement: keep the runtime imports (START_ENVIRONMENT_NAMES, tanStackStartVite)
in the existing import block and move TanStackStartViteInputConfig and
TanStackStartVitePluginCoreOptions into a separate "import type" line so the
file imports look like runtime imports first and type imports second, satisfying
import/consistent-type-specifier-style while preserving usage of
START_ENVIRONMENT_NAMES and tanStackStartVite.

---

Nitpick comments:
In `@packages/start-plugin-core/src/vite/createVirtualModule.ts`:
- Around line 4-7: Replace the unsafe this: any in the VirtualModuleLoadHandler
type with Vite's PluginContext to get proper typings for this.environment,
this.error, etc.; import type { PluginContext } from 'vite' and update the type
to use that symbol (e.g., this: PluginContext) so all load handlers using
VirtualModuleLoadHandler gain compile-time safety while preserving behavior.

In `@packages/start-plugin-core/src/vite/plugins.ts`:
- Around line 20-22: The load() function currently returns a string using
normalizePath(opts.getClientEntry()).replaceAll('\\', '/'); remove the redundant
.replaceAll('\\', '/') because normalizePath already converts backslashes to
forward slashes; update the load() return expression to use only
normalizePath(opts.getClientEntry()) and keep the JSON.stringify wrapping as-is
so the module import path remains correct.

In `@packages/start-plugin-core/tests/createVirtualModule.test.ts`:
- Around line 1-38: Add an edge-case test in createVirtualModule.test.ts that
ensures resolveId.handler and load.handler return undefined for non-matching
IDs: create another test using a plugin from createVirtualModule (e.g., moduleId
'virtual:test-module' and '#virtual:test-module') and call resolveId.handler and
load.handler with unrelated strings (like 'other-module' and '\0other-module')
asserting they return undefined to validate non-matching behavior.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd152089-06da-4906-9253-954c82498789

📥 Commits

Reviewing files that changed from the base of the PR and between 328d7e5 and 5f99d56.

📒 Files selected for processing (16)
  • .changeset/rare-pigs-smash.md
  • packages/react-start-rsc/src/plugin/vite.ts
  • packages/react-start/src/plugin/vite.ts
  • packages/solid-start/src/plugin/vite.ts
  • packages/start-plugin-core/package.json
  • packages/start-plugin-core/src/index.ts
  • packages/start-plugin-core/src/vite/createVirtualModule.ts
  • packages/start-plugin-core/src/vite/dev-server-plugin/plugin.ts
  • packages/start-plugin-core/src/vite/plugin.ts
  • packages/start-plugin-core/src/vite/plugins.ts
  • packages/start-plugin-core/src/vite/serialization-adapters-plugin.ts
  • packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts
  • packages/start-plugin-core/src/vite/start-manifest-plugin/plugin.ts
  • packages/start-plugin-core/tests/createVirtualModule.test.ts
  • packages/start-plugin-core/tests/virtual-client-entry-plugin.test.ts
  • packages/vue-start/src/plugin/vite.ts
💤 Files with no reviewable changes (1)
  • packages/start-plugin-core/package.json

nx-cloud[bot]

This comment was marked as outdated.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 13, 2026

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing fix-6588 (b8c884e) with main (328d7e5)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (c373feb) during the generation of this report, so 328d7e5 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

schiller-manuel and others added 2 commits April 13, 2026 22:02
…gin.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 3 file(s) based on 3 unresolved review comments.

Files modified:

  • packages/react-start-rsc/src/plugin/vite.ts
  • packages/solid-start/src/plugin/vite.ts
  • packages/vue-start/src/plugin/vite.ts

Commit: be3b2b504489d7774ab81784d5ce58cbfeafdc94

The changes have been pushed to the fix-6588 branch.

Time taken: 7m 13s

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
packages/react-start/src/plugin/vite.ts (1)

5-8: ⚠️ Potential issue | 🟡 Minor

Adjust import order to satisfy import/order.

Line 5-8 currently violates the configured import ordering rule from static analysis. Move this type import below the ./shared value import block.

Proposed fix
 import {
   START_ENVIRONMENT_NAMES,
   tanStackStartVite,
 } from '@tanstack/start-plugin-core'
-import type {
-  TanStackStartViteInputConfig,
-  TanStackStartVitePluginCoreOptions,
-} from '@tanstack/start-plugin-core'
 import {
   configureRsc,
   reactStartRscVitePlugin,
 } from '@tanstack/react-start-rsc/plugin/vite'
 import path from 'pathe'
 import { reactStartDefaultEntryPaths, reactStartPluginDir } from './shared'
+import type {
+  TanStackStartViteInputConfig,
+  TanStackStartVitePluginCoreOptions,
+} from '@tanstack/start-plugin-core'
 import type { PluginOption } from 'vite'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react-start/src/plugin/vite.ts` around lines 5 - 8, Move the
type-only import of TanStackStartViteInputConfig and
TanStackStartVitePluginCoreOptions so it appears after the existing value import
from './shared' to satisfy the import/order rule; locate the import statement
currently bringing in those types and cut/paste it directly below the import
that references './shared' (ensuring it remains a type import).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/react-start/src/plugin/vite.ts`:
- Around line 5-8: Move the type-only import of TanStackStartViteInputConfig and
TanStackStartVitePluginCoreOptions so it appears after the existing value import
from './shared' to satisfy the import/order rule; locate the import statement
currently bringing in those types and cut/paste it directly below the import
that references './shared' (ensuring it remains a type import).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b9570a49-90e8-48fd-b09b-63abbd56abd7

📥 Commits

Reviewing files that changed from the base of the PR and between 5f99d56 and 4a67907.

📒 Files selected for processing (2)
  • packages/react-start/src/plugin/vite.ts
  • packages/start-plugin-core/src/vite/serialization-adapters-plugin.ts

coderabbitai bot and others added 2 commits April 13, 2026 20:10
Fixed 3 file(s) based on 3 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
nx-cloud[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

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

✅ The fix from Nx Cloud was applied

We fixed the ESLint import/order violation in start-compiler-plugin/plugin.ts that was introduced when the PR added createVirtualModule and resolveViteId imports after the existing ./module-specifier import. Moving those two imports above ./module-specifier restores the correct order (parent-directory before same-directory), resolving the lint failure.

Tip

We verified this fix by re-running @tanstack/start-plugin-core:test:eslint.

Suggested Fix changes
diff --git a/packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts b/packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts
index d48fa65a27..7ef0cecfcd 100644
--- a/packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts
+++ b/packages/start-plugin-core/src/vite/start-compiler-plugin/plugin.ts
@@ -15,12 +15,12 @@ import {
 import { loadModuleForViteCompiler } from '../../start-compiler/load-module'
 import { generateServerFnResolverModule } from '../../start-compiler/server-fn-resolver-module'
 import { cleanId } from '../../start-compiler/utils'
+import { createVirtualModule } from '../createVirtualModule'
+import { resolveViteId } from '../../utils'
 import {
   createViteDevServerFnModuleSpecifierEncoder,
   decodeViteDevServerModuleSpecifier,
 } from './module-specifier'
-import { createVirtualModule } from '../createVirtualModule'
-import { resolveViteId } from '../../utils'
 import type { CompileStartFrameworkOptions } from '../../types'
 import type {
   GenerateFunctionIdFnOptional,

Revert fix via Nx Cloud  

View interactive diff ↗

➡️ This fix was applied by manuel.schiller@caligano.de

🎓 Learn more about Self-Healing CI on nx.dev

Co-authored-by: schiller-manuel <schiller-manuel@users.noreply.github.com>
@schiller-manuel schiller-manuel merged commit a581680 into main Apr 13, 2026
16 checks passed
@schiller-manuel schiller-manuel deleted the fix-6588 branch April 13, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Start] virtual:tanstack-start-client-entry 404 in pnpm monorepo

1 participant