application builder's dev-server doesn't work with imports of html files from ts
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/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ệ
- typescript, vite, webpack
- Lĩnh vực
- build-system, cli, devtools
Hướng nghiên cứu
Start with the StackBlitz reproduction and src/main.ts, then trace the application builder's serve handling for the configured .html file loader and compare it with the working SVG case and ng build output. Done means the serve command returns test.html's contents instead of index.html, while the existing SVG behavior remains working.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Command
serve
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When configuring a file loader for .html, the asset doesn't seem to get added to the list of files served by vite. This does work with ng build, as well as with the webpack builder's serve function, as well as with other filetypes (svg in the demo below).
Minimal Reproduction
https://stackblitz.com/edit/stackblitz-starters-ejbbdzyh?file=src%2Fmain.ts
See that the clicking on the SVG works fine (you get a giant purple square), but when clicking on the HTML link instead of the test file's contents you get what is, effectively, index.html. However if you do a ng build, the test.html will end up properly in the target directory.
Exception or Error
Request for HTML file "/media/test.html" was received but no asset found. Asset may be missing from build.
Your Environment
Angular CLI : 22.2.0
Angular : 22.2.0
Node.js : 22.22.3
Package Manager : npm 10.8.2
Operating System : linux x64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 22.2.0 │ ^22.2.0 │
│ @angular/cli │ 22.2.0 │ ^22.2.0 │
│ @angular/common │ 22.2.0 │ ^22.2.0 │
│ @angular/compiler │ 22.2.0 │ ^22.2.0 │
│ @angular/compiler-cli │ 22.2.0 │ ^22.2.0 │
│ @angular/core │ 22.2.0 │ ^22.2.0 │
│ @angular/forms │ 22.2.0 │ ^22.2.0 │
│ @angular/platform-browser │ 22.2.0 │ ^22.2.0 │
│ @angular/router │ 22.2.0 │ ^22.2.0 │
│ rxjs │ 7.8.2 │ ^7.8.1 │
│ typescript │ 6.0.3 │ ^6.0.3 │
│ zone.js │ 0.16.1 │ ^0.16.1 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else relevant?
No response
- Ngôn ngữ chính
- TypeScript
- Star
- 27k
- Fork
- 11.8k
- Merge trung bình
- 17 giờ 47 phút
- Pull request đã merge (30 ngày)
- 181
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 angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-server Đang mởarea: @angular/build gemini-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
angular/angular-cli#33055 · 1 bình luận · 3 reaction ·
-
Angular CLI can copy files from outside the workspace root through symlinked asset directories Đang mởarea: @angular/build gemini-triaged
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
angular/angular-cli#34164 ·
-
area: @angular/build gemini-triaged severity5: regression
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 75/100
angular/angular-cli#34163 ·
-
area: @angular/build gemini-triaged severity5: regression
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
angular/angular-cli#34162 · 1 bình luận · 1 reaction ·
Tất cả issue của angular/angular-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
receptron/mulmoterminal#2264 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
components-web-app/docs#96 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
simonsobs/tileviewer#114 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100