TanStack / TanStack/devtools

Solid.js 'multiple instances' warnings appear in React apps with Vite 8

未关闭
#411 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
499
派生
100
平均合并
1 天 17 小时
30 天内合并 PR
4

描述

TanStack Devtools version

@tanstack/react-devtools v0.10.1, @tanstack/devtools-vite v0.6.0

Framework/Library version

React 19.2.4, TanStack Start 1.167.16, Vite 8.0.3

Describe the bug and the steps to reproduce it

When using TanStack Devtools in a React TanStack Start app with Vite 8, the following warnings appear in the terminal and browser when starting the dev server

❯ bun run dev
$ vite dev --port 3000

  VITE v8.0.3  ready in 1039 ms

  ➜  Local:   http://localhost:3000/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
[vite] connected.
9:48:32 AM [vite] (client) [console.warn] You appear to have multiple instances of Solid. This can lead to unexpected behavior.
9:48:32 AM [vite] (client) [console.warn] You appear to have multiple instances of Solid. This can lead to unexpected behavior.
9:48:32 AM [vite] (client) [console.warn] computations created outside a `createRoot` or `render` will never be disposed
9:48:32 AM [vite] (client) [console.warn] computations created outside a `createRoot` or `render` will never be disposed
9:48:32 AM [vite] (client) [console.warn] cleanups created outside a `createRoot` or `render` will never be run
9:48:32 AM [vite] (client) [console.warn] computations created outside a `createRoot` or `render` will never be disposed
9:48:32 AM [vite] (client) [console.warn] computations created outside a `createRoot` or `render` will never be disposed
9:48:32 AM [vite] (client) [console.warn] cleanups created outside a `createRoot` or `render` will never be run
9:48:32 AM [vite] (client) [console.warn] computations created outside a `createRoot` or `render` will never be disposed
9:48:32 AM [vite] (client) [console.warn] cleanups created outside a `createRoot` or `render` will never be run
9:48:32 AM [vite] (client) [console.warn] cleanups created outside a `createRoot` or `render` will never be run
9:48:32 AM [vite] (client) [console.warn] computations created outside a `createRoot` or `render` will never be disposed

These warnings do not appear with Vite 7 using the exact same dependencies and configuration.

Steps to reproduce:

  1. Clone the repro repo and install dependencies:
    git clone https://github.com/abed-daloopa/tanstack-devtools-solid-warnings
    cd tanstack-devtools-solid-warnings
    bun install
    
  2. Run the dev server:
    bun run dev
    
  3. Open http://localhost:3000 — warnings appear in the browser console and terminal.

To verify Vite 8 is the cause, downgrade to Vite 7:

- "vite": "^8.0.3"
+ "vite": "^7.3.1"

Or add resolve.dedupe: ["solid-js"] to vite config

Reinstall and run ➡︎ warnings disappear.

Root cause: Vite 8 resolves Solid.js as multiple instances at runtime, even when only one copy exists in node_modules. Vite correctly deduplicates it.

Note: Adding resolve.dedupe: ["solid-js"] to the Vite config fixes the issue.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://github.com/abed-daloopa/tanstack-devtools-solid-warnings

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Maybe

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从链接的最小复现及其 Vite 配置开始,然后比较 Vite 7 和 Vite 8 下开发服务器的行为。检查 TanStack devtools 的 Vite 集成以及报告中的 Solid.js 解析路径;完成标准是 Vite 8 设置不再发出重复实例和 disposal 警告,且无需依赖报告中的 dedupe workaround。

由索引模型根据 Issue 内容生成。

评估

技术栈
react, typescript, vite
领域
build-system, devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。