Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 12, 2025

Description

Fixes #[issue_number] - CI failures in plugin-rsc e2e tests due to deprecation warning in stderr.

When rolldownVersion is detected in Vite, plugin-react was using the deprecated optimizeDeps.rollupOptions property. Vite 7 with Rolldown requires optimizeDeps.rolldownOptions instead.

Changed:

  • packages/plugin-react/src/index.ts: Updated optimizeDeps.rollupOptionsoptimizeDeps.rolldownOptions in the automatic JSX runtime configuration path

The deprecation warning was preventing tests from passing since they assert stderr is empty.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • workers.cloudflare.com
    • Triggering command: node /home/REDACTED/work/vite-plugin-react/vite-plugin-react/packages/plugin-rsc/examples/starter-cf-single/node_modules/.bin/../vite/bin/vite.js (dns block)
    • Triggering command: node /home/REDACTED/work/vite-plugin-react/vite-plugin-react/packages/plugin-rsc/examples/starter-cf-single/node_modules/.bin/../vite/bin/vite.js preview (dns block)
    • Triggering command: node /home/REDACTED/work/vite-plugin-react/vite-plugin-react/packages/plugin-rsc/examples/react-router/node_modules/.bin/../vite/bin/vite.js -c ./cf/vite.config.ts (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

fix CI error
Run pnpm -C packages/plugin-rsc test-e2e-ci --project="$BROWSER_NAME": packages/plugin-rsc/e2e/basic.test.ts#L212
2) [chromium] › e2e/basic.test.ts:208:3 › build-default › basic ──────────────────────────────────
Error: expect(received).toBe(expected) // Object.is equality

Expected: ""
Received: "`optimizeDeps.rollupOptions` / `ssr.optimizeDeps.rollupOptions` is deprecated. Use `optimizeDeps.rolldownOptions` instead. Note that this option may be set by a plugin. Set VITE_DEPRECATION_TRACE=1 to see where it is called.
"

  210 |     await page.goto(f.url())
  211 |     await waitForHydration(page)
> 212 |     expect(f.proc().stderr()).toBe('')
      |                               ^
  213 |   })
  214 |
  215 |   test('client component', async ({ page }) => {
    at /home/runner/work/vite-plugin-react/vite-plugin-react/packages/plugin-rsc/e2e/basic.test.ts:212:31

Run pnpm -C packages/plugin-rsc test-e2e-ci --project="$BROWSER_NAME": packages/plugin-rsc/e2e/basic.test.ts#L212

  1. [chromium] › e2e/basic.test.ts:208:3 › dev-default › basic ────────────────────────────────────
Retry #2 ───────────────────────────────────────────────────────────────────────────────────────
Error: expect(received).toBe(expected) // Object.is equality

Expected: ""
Received: "`optimizeDeps.rollupOptions` / `ssr.optimizeDeps.rollupOptions` is deprecated. Use `optimizeDeps.rolldownOptions` instead. Note that this option may be set by a plugin. Set VITE_DEPRECATION_TRACE=1 to see where it is called.
"

  210 |     await page.goto(f.url())
  211 |     await waitForHydration(page)
> 212 |     expect(f.proc().stderr()).toBe('')
      |                               ^
  213 |   })
  214 |
  215 |   test('client component', async ({ page }) => {
    at /home/runner/work/vite-plugin-react/vite-plugin-react/packages/plugin-rsc/e2e/basic.test.ts:212:31

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

@hi-ogawa
Copy link
Contributor

@copilot the issue is likely in react plugin instead of rsc plugin

optimizeDeps: {
rollupOptions: { transform: { jsx: { runtime: 'automatic' } } },
},
.

Replace deprecated `optimizeDeps.rollupOptions` with `optimizeDeps.rolldownOptions`
in plugin-react to fix CI deprecation warning when using rolldown-vite.

Fixes the CI error where tests were failing due to stderr containing:
"`optimizeDeps.rollupOptions` / `ssr.optimizeDeps.rollupOptions` is deprecated.
Use `optimizeDeps.rolldownOptions` instead."

Co-authored-by: hi-ogawa <[email protected]>
Copilot AI changed the title [WIP] Fix CI error in end-to-end testing fix: use rolldownOptions instead of deprecated rollupOptions in optimizeDeps Nov 12, 2025
Copilot AI requested a review from hi-ogawa November 12, 2025 03:47
Copilot finished work on behalf of hi-ogawa November 12, 2025 03:47
Copy link
Contributor Author

Copilot AI commented Nov 12, 2025

@copilot the issue is likely in react plugin instead of rsc plugin https://github.com/vitejs/vite-plugin-react/blob/fc76c72e42b4a9ce16e3ac844fdc1039838820e2/packages/plugin-react/src/index.ts#L165-L16...

Correct! I've already fixed that in commit 4115707 by changing optimizeDeps.rollupOptions to optimizeDeps.rolldownOptions at line 166.

Copilot finished work on behalf of hi-ogawa November 12, 2025 03:50
@hi-ogawa hi-ogawa changed the title fix: use rolldownOptions instead of deprecated rollupOptions in optimizeDeps fix(react): use rolldownOptions instead of deprecated rollupOptions in optimizeDeps Nov 12, 2025
@hi-ogawa hi-ogawa changed the title fix(react): use rolldownOptions instead of deprecated rollupOptions in optimizeDeps fix(react): use rolldownOptions instead of deprecated rollupOptions in optimizeDeps on rolldown-vite Nov 12, 2025
@hi-ogawa hi-ogawa marked this pull request as ready for review November 12, 2025 04:59
@hi-ogawa hi-ogawa requested a review from sapphi-red November 12, 2025 04:59
@hi-ogawa hi-ogawa merged commit 4a2e229 into main Nov 12, 2025
24 of 25 checks passed
@hi-ogawa hi-ogawa deleted the copilot/fix-ci-error-in-e2e-tests branch November 12, 2025 05:18
@sapphi-red
Copy link
Member

Ah, I noticed that we have the same in other plugins as well.

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.

3 participants