optimisation warning conflicts with large React library barrels
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
- 54/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, vite
Hướng nghiên cứu
Start with the plugin-rsc use-client optimization warning and reproduce it using the linked vite-rsc-bundling example: run npm install and npm run dev, then open the app. Compare the warning and browser requests for the lucide-react barrel import with the subpath import workaround described in the issue. Done means finding a way to avoid the warning without requesting the full icon module graph during development.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Related plugins
Describe the bug
When a React library has a large barrel entry, @vitejs/plugin-rsc warns that the dependency is inconsistently optimised:
16:30:30 [vite] (rsc) warning: client component dependency is inconsistently optimized. It's recommended to add the dependency to 'optimizeDeps.exclude'.
Plugin: rsc:use-client
File: /Users/karl.stoney/git/vite-rsc-bundling/node_modules/lucide-react/dist/esm/Icon.mjs?v=233653df
16:30:31 [vite] (rsc) warning: client component dependency is inconsistently optimized. It's recommended to add the dependency to 'optimizeDeps.exclude'.
Plugin: rsc:use-client
File: /Users/karl.stoney/git/vite-rsc-bundling/node_modules/lucide-react/dist/esm/context.mjs?v=233653df
For lucide-react, following that recommendation removes the warning but causes the browser to request the entire icon module graph (2000+ icons individually) during development, even when only one icon is used.
There is a workaround in my repro (not using the barrel import, and importing from subpaths directly) but it seems odd to need to do this.
Reproduction
https://github.com/Stono/vite-rsc-bundling
Steps to reproduce
npm install then npm run dev, then open it. More info in the README
System Info
System:
OS: macOS 26.6.1
CPU: (14) arm64 Apple M4 Max
Memory: 928.25 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.22.2 - /Users/karl.stoney/.local/state/fnm_multishells/79801_1794241455736/bin/node
npm: 11.19.1 - /Users/karl.stoney/.local/state/fnm_multishells/79801_1794241455736/bin/npm
Browsers:
Safari: 27.0
npmPackages:
@vitejs/plugin-rsc: 0.5.39 => 0.5.39
vite: 8.3.7 => 8.3.7
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.2k
- Fork
- 287
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vitejs/vite-plugin-react
-
plugin-rsc: a client reference's CSS is linked before the CSS of the chunks it imports (build)Có thể đã có người làm @wozhenbang2004 đã nhận 6 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
vitejs/vite-plugin-react#1570 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pending triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
vitejs/vite-plugin-react#1581 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[plugin-rsc] Build exits 0, but the app fails at runtime: a server action imported only by browser code is missing from the RSC buildCó thể đã có người làm @NeilPant đã nhận 3 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
vitejs/vite-plugin-react#1578 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
vitejs/vite-plugin-react#1577 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[plugin-rsc] inline "use server" function declarations lose hoisting and throw TDZ ReferenceErrorCó thể đã có người làm @draarivpatel-ui đã nhận 2 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
vitejs/vite-plugin-react#1566 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vitejs/vite-plugin-react
Issue tương tự
-
ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
mermaid-js/mermaid-v13#1370 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
compiler: the island_chunks_not_emitted report gives a count but not which islands were skippedĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Broken Website
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
darkreader/darkreader#16259 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ARTPARK-SAHAI-ORG/calibrate-frontend#919 ·
Maintainer thường phản hồi trong vòng 1 ngày