diff --git a/packages/angular/build/src/tools/vite/middlewares/html-fallback-middleware.ts b/packages/angular/build/src/tools/vite/middlewares/html-fallback-middleware.ts index 395368be0c00..cd52b8a7904f 100644 --- a/packages/angular/build/src/tools/vite/middlewares/html-fallback-middleware.ts +++ b/packages/angular/build/src/tools/vite/middlewares/html-fallback-middleware.ts @@ -28,7 +28,10 @@ export function angularHtmlFallbackMiddleware( if (req.url) { const mimeType = lookupMimeTypeFromRequest(req.url); - if (mimeType === 'text/html' || mimeType === 'application/xhtml+xml') { + if ( + (mimeType === 'text/html' || mimeType === 'application/xhtml+xml') && + !/^\/index\.(?:csr\.)?html/.test(req.url) + ) { // eslint-disable-next-line no-console console.warn( `Request for HTML file "${req.url}" was received but no asset found. Asset may be missing from build.`,