Skip to content

rsc plugin unit test is flaky #1036

@hi-ogawa

Description

@hi-ogawa

We are getting this error for some time now https://github.com/vitejs/vite-plugin-react/actions/runs/20707908880/job/59441944055#step:8:24

Run pnpm -C packages/plugin-rsc test

> @vitejs/[email protected] test /home/runner/work/vite-plugin-react/vite-plugin-react/packages/plugin-rsc
> vitest


 RUN  v4.0.16 /home/runner/work/vite-plugin-react/vite-plugin-react/packages/plugin-rsc

 ✓ src/transforms/wrap-export.test.ts (17 tests) 29ms
 ✓ src/transforms/hoist.test.ts (10 tests) 33ms
 ✓ src/transforms/waku.test.ts (13 tests) 36ms
 ✓ src/transforms/proxy-export.test.ts (10 tests) 28ms
 ❯ src/plugins/scan.test.ts (1 test | 1 failed) 4ms
     × basic 3ms
 ✓ src/transforms/cjs.test.ts (6 tests) 86ms

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  src/plugins/scan.test.ts > transformScanBuildStrip > basic
TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
 ❯ transformScanBuildStrip src/plugins/scan.ts:29:21
     27| 
     28| export async function transformScanBuildStrip(code: string): Promise<s…
     29|   const [imports] = esModuleLexer.parse(code)
       |                     ^
     30|   let output = imports
     31|     .map((e) => e.n && `import ${JSON.stringify(e.n)};\n`)
 ❯ src/plugins/scan.test.ts:16:18

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯


 Test Files  1 failed | 5 passed (6)
      Tests  1 failed | 56 passed (57)
   Start at  07:12:43
   Duration  918ms (transform 225ms, setup 0ms, import 1.51s, tests 216ms, environment 1ms)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions