Angular generates chunks with no content on production build causes deployment issues related to MIME type #30376
Labels
needs: repro steps
We cannot reproduce the issue with the information given
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
Angular 19 production builds (ng build --configuration production) are sometimes generating empty (0-byte) or malformed JavaScript chunk files (chunk-XXXXX.js). When deployed, browsers attempt to load these, resulting in "Failed to load module script: The server responded with a non-JavaScript MIME type" errors because the server serves an incorrect MIME type (e.g., text/html). This prevents the application from loading and causes significant deployment issues.
Impact: Application failure to load in production, broken user experience, difficult debugging due to misleading MIME type errors.
Expected Behavior: All production build chunks should contain valid JavaScript content and be served with text/javascript MIME type.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: