Skip to content

fix(react): force Vite 7 when using React Router in framework mode#35101

Merged
jaysoo merged 1 commit intomasterfrom
NXC-4176
Mar 31, 2026
Merged

fix(react): force Vite 7 when using React Router in framework mode#35101
jaysoo merged 1 commit intomasterfrom
NXC-4176

Conversation

@jaysoo
Copy link
Copy Markdown
Member

@jaysoo jaysoo commented Mar 31, 2026

Current Behavior

Creating a custom React workspace with React Router for server rendering (framework mode) fails due to a peer dependency conflict between Vite 8 and React Router. Vite 8 is the current default for new workspaces, but @react-router/dev does not yet support it.

Expected Behavior

The React application generator uses Vite 7 when React Router is selected, avoiding the peer dependency conflict until React Router adds Vite 8 support.

image

Related Issue(s)

Fixes NXC-4176

## Current Behavior
Creating a custom React workspace with React Router for server rendering
fails due to peer dependency conflicts between Vite 8 and React Router.

## Expected Behavior
The React application generator uses Vite 7 when React Router is selected,
avoiding the peer dependency conflict until React Router adds Vite 8 support.

## Related Issue(s)
Fixes NXC-4176
@jaysoo jaysoo requested a review from a team as a code owner March 31, 2026 16:10
@jaysoo jaysoo requested a review from AgentEnder March 31, 2026 16:10
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 31, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 09e6646
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69cbf214c553a0000821a2d0
😎 Deploy Preview https://deploy-preview-35101--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 31, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 09e6646
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69cbf2145dfd410008e9e04b
😎 Deploy Preview https://deploy-preview-35101--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud bot commented Mar 31, 2026

View your CI Pipeline Execution ↗ for commit 09e6646

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 1h 11m 51s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 4s View ↗
nx-cloud record -- pnpm nx conformance:check ✅ Succeeded 7s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-31 17:27:35 UTC

@jaysoo jaysoo merged commit 2cfc289 into master Mar 31, 2026
25 checks passed
@jaysoo jaysoo deleted the NXC-4176 branch March 31, 2026 17:32
vsavkin pushed a commit that referenced this pull request Mar 31, 2026
…35101)

## Current Behavior

Creating a custom React workspace with React Router for server rendering
(framework mode) fails due to a peer dependency conflict between Vite 8
and React Router. Vite 8 is the current default for new workspaces, but
`@react-router/dev` does not yet support it.

## Expected Behavior

The React application generator uses Vite 7 when React Router is
selected, avoiding the peer dependency conflict until React Router adds
Vite 8 support.

<img width="1270" height="1204" alt="image"
src="https://github.com/user-attachments/assets/87495e85-20df-4086-a1f0-eb3380a78771"
/>


## Related Issue(s)

Fixes NXC-4176
FrozenPandaz pushed a commit that referenced this pull request Mar 31, 2026
…35101)

## Current Behavior

Creating a custom React workspace with React Router for server rendering
(framework mode) fails due to a peer dependency conflict between Vite 8
and React Router. Vite 8 is the current default for new workspaces, but
`@react-router/dev` does not yet support it.

## Expected Behavior

The React application generator uses Vite 7 when React Router is
selected, avoiding the peer dependency conflict until React Router adds
Vite 8 support.

<img width="1270" height="1204" alt="image"
src="https://github.com/user-attachments/assets/87495e85-20df-4086-a1f0-eb3380a78771"
/>

## Related Issue(s)

Fixes NXC-4176

(cherry picked from commit 2cfc289)
FrozenPandaz added a commit that referenced this pull request Apr 1, 2026
… conflict (#35110)

## Current Behavior

The react-router typecheck e2e test fails in CI because pnpm resolves
both vite 7 and vite 8 in the generated project. `@react-router/dev`
picks up vite 8 plugin types while `defineConfig` uses vite 7 types,
causing a TypeScript incompatibility.

## Expected Behavior

The test is skipped until `@react-router/dev` adds Vite 8 support, at
which point the `useViteV7` workaround and this skip can both be
removed.

## Related Issue(s)

Follow-up to #35101
vsavkin pushed a commit that referenced this pull request Apr 1, 2026
… conflict (#35110)

## Current Behavior

The react-router typecheck e2e test fails in CI because pnpm resolves
both vite 7 and vite 8 in the generated project. `@react-router/dev`
picks up vite 8 plugin types while `defineConfig` uses vite 7 types,
causing a TypeScript incompatibility.

## Expected Behavior

The test is skipped until `@react-router/dev` adds Vite 8 support, at
which point the `useViteV7` workaround and this skip can both be
removed.

## Related Issue(s)

Follow-up to #35101
FrozenPandaz added a commit that referenced this pull request Apr 1, 2026
… conflict (#35110)

## Current Behavior

The react-router typecheck e2e test fails in CI because pnpm resolves
both vite 7 and vite 8 in the generated project. `@react-router/dev`
picks up vite 8 plugin types while `defineConfig` uses vite 7 types,
causing a TypeScript incompatibility.

## Expected Behavior

The test is skipped until `@react-router/dev` adds Vite 8 support, at
which point the `useViteV7` workaround and this skip can both be
removed.

## Related Issue(s)

Follow-up to #35101

(cherry picked from commit 6962a3d)
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants