Last 12 weeks · 98 commits
5 of 6 standards met
Related plugins [x] plugin-react [ ] plugin-react-swc [ ] plugin-react-oxc [ ] plugin-rsc Describe the bug Description: Problem The @vitejs/plugin-react injects react-refresh code as a virtual module (/@react-refresh) into the HTML: import { injectIntoGlobalHook } from "/@react-refresh"; // ... The react-refresh package (since v0.17.0) uses modern JavaScript syntax like: Optional chaining (?.) Nullish coalescing operator (??) These ES2020 features are not supported in older browsers like Chrome 69 (released Aug 2018), causing syntax errors: Uncaught SyntaxError: Unexpected token '.' Current Behavior Configuring optimizeDeps.esbuildOptions.target: 'chrome69' does NOT help, because the injected @react-refresh virtual module bypasses the optimizeDeps pipeline. The virtual module is generated internally by the plugin. Expected Behavior The plugin should transpile the injected react-refresh code to match the configured browser target, or provide an option to do so. Possible Solutions 1. Add a target option to the plugin that transpiles the injected react-refresh code 2. Use esbuild to transform the injected code based on build.target or a dedicated option 3. Downgrade react-refresh internally for legacy browser support (less ideal) Workaround Currently, the only workaround is to pin react-refresh to v0.13.0 which doesn't use these modern syntax features. Environment Target browser: Chrome 69 Reproduction none Steps to reproduce _No response_ System Info Used Package Manager yarn Logs _No response_ Validations [x] Follow our Code of Conduct [x] Read the Contributing Guidelines. [x] Read the docs. [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. [x] Make sure this is a Vite issue and not a framework-specific issue. [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server. [x] The provided reproduction is a minimal reproducible example of the bug.
Description We don't normally need this since server doesn't optimize, but this is more correct (like we already do exclude own ) since the idea is to apply vite transform to those dependencies. This will likely help integrations with cloudflare plugin, which employs server optimize deps via : https://github.com/cloudflare/vinext/pull/18 TODO [x] test Indeed, we already had explicit in the example. After this change, it's not necessary.
Repository: vitejs/vite-plugin-react. Description: The all-in-one Vite plugin for React projects. Stars: 1008, Forks: 233. Primary language: TypeScript. Languages: TypeScript (89.5%), JavaScript (6%), CSS (3.2%), HTML (1.2%), MDX (0.1%). License: MIT. Latest release: plugin-rsc@0.5.21 (2d ago). Open PRs: 30, open issues: 41. Last activity: 1d ago. Community health: 87%. Top contributors: hi-ogawa, renovate[bot], yyx990803, ArnaudBarre, sapphi-red, patak-cat, antfu, Copilot, Shinigami92, bluwy and others.
Description _Built on top of #1124_ In Vite 8 (currently beta), react refresh transform can be handled by Oxc. This means there's no transform that uses babel by default. To reduce the install size, I think we should remove babel from the dependency of . The package lives at https://github.com/rolldown/plugins. context: https://github.com/vitejs/vite-plugin-react/discussions/1114
Related plugins [ ] plugin-react [x] plugin-react-swc [ ] plugin-react-oxc [ ] plugin-rsc Description nodejs 24 has been promoted to lts in Oktober 2025. The packages in here do not specify support for them yet as they require . Suggested solution Widen the supported versions to allow node 24 if applicable. Alternative _No response_ Additional context I'm open to make a PR but wanted to ask if there is any blocker you know of. Validations [x] Follow our Code of Conduct [x] Read the Contributing Guidelines. [x] Read the docs. [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.