voidzero-dev / voidzero-dev/vite-plus

Vite+ config errors on running tests after scaffolding react compiler

Đang mở
#1,229 5 bình luận 3 reaction 0 người được giao Xem trên GitHub
pending triage
Ngôn ngữ chính
Rust
Star
5.8k
Fork
262
Merge trung bình
23 giờ 18 phút
Pull request đã merge (30 ngày)
139

Mô tả

### Describe the bug

I scaffolded a tanstack start app using `vp create` opting to use react compiler.
`vp test` runs and test passes but hangs with errors denoting possibly some CJS loading confusion with react lib.
To make testing work with react compiler enabled, I had to create a separate `vitest.config.ts`.

I know the repro app I shared, has errors and warnings due to missing vite 8 react compiler related changes in default tanstack start scaffold but even after fixing that with new rolldown babel plugin same error will occur. I just kept it as is to keep repro steps minimum. If you create any tests those will run successfully but process still hangs with same error.

On a side note the Vite+ start template is using old cli of Tanstack start they recommend a new one now.

### Reproduction

https://github.com/SiddharthPant/vp-test

### Steps to reproduce

```bash
vp create @tanstack/start
VITE+ - The Unified Toolchain for the Web

◇ Which package manager would you like to use?
pnpm

◇ pnpm@10.33.0 installed

◇ Which agents are you using?
ChatGPT (Codex), Claude Code

◇ Which editor are you using?
VSCode

◇ Set up pre-commit hooks to run formatting, linting, and type checking with auto-fixes?
Yes

Generating project…

Running: pnpm dlx @tanstack/create-start --no-install --no-toolchain
Warning: @tanstack/create-start is deprecated. Use "tanstack create" or "npx @tanstack/cli create" instead.
See: https://tanstack.com/start/latest/docs/framework/react/quick-start

┌ Let's configure your TanStack Start application

◇ What would you like to name your project?
│ vp-test

◇ Select deployment adapter
│ Nitro (agnostic)

◇ Would you like to include demo/example pages?
│ No
...... ===========Choose Compiler here to cause the bug in testing===============......
◇ What add-ons would you like for your project?
│ Compiler

◇ Would you like to initialize a new git repository?
│ Yes
....
◇ Scaffolded vp-test
• Node 24.14.1 pnpm 10.33.0
✓ Dependencies installed in 15s
→ Next: cd vp-test && vp dev
```

### System Info

```shell
`vp env current`

VITE+ - The Unified Toolchain for the Web

Environment:
Version 24.14.1
Source lts

Tool Paths:
node /Users/sid/.vite-plus/js_runtime/node/24.14.1/bin/node
npm /Users/sid/.vite-plus/js_runtime/node/24.14.1/bin/npm
npx /Users/sid/.vite-plus/js_runtime/node/24.14.1/bin/npx

`vp --version`

VITE+ - The Unified Toolchain for the Web

vp v0.1.14

Local vite-plus:
vite-plus v0.1.14

Tools:
vite v8.0.2
rolldown v1.0.0-rc.11
vitest v4.1.1
oxfmt v0.42.0
oxlint v1.57.0
oxlint-tsgolint v0.17.3
tsdown v0.21.4

Environment:
Package manager pnpm v10.33.0
Node.js v24.14.1
```

### Used Package Manager

pnpm

### Logs

```shell
~/projects/vp-test ❯ vp test on  main via  v24.14.1
VITE+ - The Unified Toolchain for the Web

The plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the resolve.tsconfigPaths option. You can remove the plugin and set resolve.tsconfigPaths: true in your Vite config instead.
RUN /Users/sid/projects/vp-test

No test files found, exiting with code 1

include: **/*.{test,spec}.?(c|m)[jt]s?(x)
exclude: **/node_modules/**, **/.git/**

ReferenceError: module is not defined
at /Users/sid/projects/vp-test/node_modules/.pnpm/react@19.2.4/node_modules/react/index.js:6:3
at ESModulesEvaluator.runInlinedModule (file:///Users/sid/projects/vp-test/node_modules/.pnpm/@voidzero-dev+vite-plus-core@0.1.14_@types+node@22.19.15_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0_typescript@5.9.3/node_modules/@voidzero-dev/vite-plus-core/dist/vite/node/module-runner.js:988:161)
at ModuleRunner.directRequest (file:///Users/sid/projects/vp-test/node_modules/.pnpm/@voidzero-dev+vite-plus-core@0.1.14_@types+node@22.19.15_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0_typescript@5.9.3/node_modules/@voidzero-dev/vite-plus-core/dist/vite/node/module-runner.js:1243:80)
at ModuleRunner.cachedRequest (file:///Users/sid/projects/vp-test/node_modules/.pnpm/@voidzero-dev+vite-plus-core@0.1.14_@types+node@22.19.15_esbuild@0.27.4_jiti@2.6.1_tsx@4.21.0_typescript@5.9.3/node_modules/@voidzero-dev/vite-plus-core/dist/vite/node/module-runner.js:1150:73)
close timed out after 10000ms
Tests closed successfully but something prevents Vite server from exiting
You can try to identify the cause by enabling "hanging-process" reporter. See https://vitest.dev/guide/reporters.html#hanging-process-reporter
```

### Validations

- [x] Read the [Contributing Guidelines](https://github.com/voidzero-dev/vite-plus/blob/main/CONTRIBUTING.md).
- [x] Check that there isn't [already an issue](https://github.com/voidzero-dev/vite-plus/issues) for the same bug.
- [x] Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện vp-test được liên kết và chạy vp test sau khi scaffold @tanstack/start với add-on Compiler. So sánh thiết lập test được tạo ra với workaround riêng vitest.config.ts, tập trung vào lỗi module được báo cáo từ react/index.js. Hoàn thành nghĩa là scaffold có Compiler chạy được vp test mà không gặp lỗi module CJS/ES, không bị treo và không bị buộc phải dùng cấu hình riêng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, node.js, react, typescript, vite
Lĩnh vực
testing, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
52/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.