Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 22, 2025

Fixes #760 by updating the rolldown detection pattern in @vitejs/plugin-rsc to match the standard approach used in @vitejs/plugin-react.

Problem

The @vitejs/plugin-rsc plugin was using an inconsistent pattern to detect rolldown-vite:

  • Used 'rolldownVersion' in this.meta instead of the standard pattern

This is inconsistent with the correct approach used in @vitejs/plugin-react, which imports the vite module and checks for the rolldownVersion property directly.

Solution

Updated the plugin to follow the same pattern as @vitejs/plugin-react:

  • Added import * as vite from 'vite'
  • Changed 'rolldownVersion' in this.meta to 'rolldownVersion' in vite

Benefits

  • Consistency: Aligns with the established pattern from the main plugin-react implementation
  • Reliability: Avoids potential issues with plugin context (this.meta) availability
  • Maintainability: Follows the standard rolldown detection approach

The changes are minimal and surgical, only updating the rolldown detection logic without affecting any other functionality.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] Fix @vitejs/vite-plugin-react/issues/760 by replace "rolldownVersion" in this.meta with const isRolldownVite = 'rolldownVersion' in vite like in packages/plugin-react/src/index.ts fix: replace "rolldownVersion" in this.meta with 'rolldownVersion' in vite pattern Aug 22, 2025
@Copilot Copilot AI requested a review from hi-ogawa August 22, 2025 23:16
Copilot finished work on behalf of hi-ogawa August 22, 2025 23:16
Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

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

@copilot revert packages/plugin-react-oxc/src/index.ts

Copy link
Contributor Author

Copilot AI commented Aug 22, 2025

@copilot revert packages/plugin-react-oxc/src/index.ts

Reverted packages/plugin-react-oxc/src/index.ts to its original state as requested (9133654)

@Copilot Copilot AI changed the title fix: replace "rolldownVersion" in this.meta with 'rolldownVersion' in vite pattern fix: replace 'rolldownVersion' in this.meta with 'rolldownVersion' in vite pattern in plugin-rsc Aug 22, 2025
@Copilot Copilot AI requested a review from hi-ogawa August 22, 2025 23:24
Copilot finished work on behalf of hi-ogawa August 22, 2025 23:24
@hi-ogawa hi-ogawa marked this pull request as ready for review August 23, 2025 02:39
@hi-ogawa hi-ogawa changed the title fix: replace 'rolldownVersion' in this.meta with 'rolldownVersion' in vite pattern in plugin-rsc fix(rsc): replace 'rolldownVersion' in this.meta with 'rolldownVersion' in vite for Vite 6 compat Aug 23, 2025
@hi-ogawa hi-ogawa merged commit af4e16d into main Aug 23, 2025
22 checks passed
@hi-ogawa hi-ogawa deleted the copilot/fix-aaf8f1f8-0074-4217-b4d1-36f7ef0e105f branch August 23, 2025 02:41
@hi-ogawa hi-ogawa mentioned this pull request Aug 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot read properties of undefined (reading 'meta')

2 participants