Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

application builder's dev-server doesn't work with imports of html files from ts

Open
#34,166 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript, vite, webpack

Research direction

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.

Written by the indexing model from the issue text.

Description

area: @angular/build gemini-triaged
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

Dominant language
TypeScript
Stars
27k
Forks
11.8k
Avg merge
17h 47m
Merged PRs (30d)
181

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from angular/angular-cli

All issues in angular/angular-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.