SSR manifest: `vite build --app --watch` embeds the previous round's client index.html

Đang mở
#705 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
46/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ệ
javascript, rust
Lĩnh vực
build-system, devtools

Hướng nghiên cứu

Read the watch-mode build flow around buildStart, generateBundle, transform, and renderChunk, then trace how the server environment reads the client index.html. Reproduce with vite build --app --watch and inspect the SSR output across consecutive rounds. Done means each round embeds the matching client page and a client-only change also updates the server output.

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

Mô tả

Follow-up to #696 (fixed in #697 for normal builds). Found while reviewing #697.

In vite build --app --watch the server environment reads the client index.html in its own buildStart. The client of the same round only writes the new page later, in generateBundle. So every round embeds the page from the round before:

round 1   embeds /src/main.ts (source page)   disk: index-CDAm_wYV.js
round 2   embeds index-CDAm_wYV.js            disk: index-DK41E1g1.js
round 3   embeds index-DK41E1g1.js            disk: index-CheYs2QK.js
→ the SSR page loads a script that is 404 and never hydrates

#697 prints a warning each round, so this is not silent, but the output is still wrong. In watch mode the two environments run at the same time, so listing client first doesn't help.

Possible fix: each client round resolves a promise in its generateBundle. The server embeds a placeholder at transform time and fills it in renderChunk / generateBundle after awaiting that promise. A client-only change also needs to rebuild (or patch) the server output.

Ngôn ngữ chính
Rust
Star
245
Fork
26
Merge trung bình
1 ngày 23 phút
Pull request đã merge (30 ngày)
83

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 voidzero-dev/oxc-angular-compiler

Tất cả issue của voidzero-dev/oxc-angular-compiler

Issue tương tự

Thêm issue về Rust

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.