react-reconciler renderers (react-three-fiber) crash at import: the react shim has no __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE (0.2.1, 0.3.1)

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript

Hướng nghiên cứu

Start by reading the Vite plugin’s React shim at dist/react/index.js and tracing how the plugin substitutes it during dependency pre-bundling. Check how react-reconciler accesses __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, then compare the proposed shim change with the alternative importer-level skip behavior. Done when a reproducer using @react-three/fiber imports and mounts successfully, or the supported limitations and workaround are documented.

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

Mô tả

What happens

Any react-reconciler based renderer breaks under the Vite plugin. With @react-three/fiber in the app, the first import of its module throws and the page never renders:

TypeError: Cannot read properties of undefined (reading 'S')
    at createReconciler (react-three-fiber.esm-*.js)

The pre-bundled fiber chunk resolves react to @tanstack/redact/dist/react/index.js. react-reconciler reads React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE at module evaluation and then .S on it; the shim does not export that object, so the read is on undefined. Same in 0.2.1 and 0.3.1 (dist/react/index.js has no __CLIENT_INTERNALS in either).

Reproduction

  • Vite 8.3.4, @vitejs/plugin-react 6.1.2, react / react-dom 19.3.1, @react-three/fiber 9.8.2, three 0.186.1, @tanstack/redact 0.2.1 (also 0.3.1).
  • vite.config.ts: plugins: [viteReact(), redact()].
  • Render any component that imports Canvas from @react-three/fiber.

Expected: the canvas mounts. Actual: the error above at import time; Storybook and Vitest, which do not run the plugin, render the same component fine.

What I tried

skip is global per specifier, so there is no way to leave one package (or one subtree) on real React while the rest of the app uses Redact. Removing the plugin fixes it.

Ask

Either expose the client internals that react-reconciler needs so custom renderers can host their own root inside a Redact tree, or document that react-reconciler renderers (@react-three/fiber, @react-pdf/renderer, ink) are out of scope and let skip exclude an importer, not only a specifier.

Ngôn ngữ chính
TypeScript
Star
537
Fork
22
Merge trung bình
11 giờ 37 phút
Pull request đã merge (30 ngày)
35

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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.

Issue khác của TanStack/redact

Tất cả issue của TanStack/redact

Issue tương tự

Thêm issue về TypeScript

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.