TanStack / TanStack/devtools

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

Đang mở
#411 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
TypeScript
Star
499
Fork
100
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
4

Mô tả

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.

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

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với bản tái hiện tối thiểu được liên kết và cấu hình Vite của nó, sau đó so sánh hành vi của dev server trên Vite 7 và Vite 8. Kiểm tra tích hợp Vite của TanStack devtools và đường dẫn phân giải Solid.js đã được báo cáo; được xem là hoàn tất khi thiết lập Vite 8 không còn phát ra các cảnh báo về instance trùng lặp và disposal mà không phụ thuộc vào dedupe workaround đã được báo cáo.

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

Đánh giá

Công nghệ
react, typescript, vite
Lĩnh vực
build-system, devtools
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.