Skip to content

Vite+ config errors on running tests after scaffolding react compiler #1229

@SiddharthPant

Description

@SiddharthPant

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

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

`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

~/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

Metadata

Metadata

Assignees

No one assigned

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions