NG.IX · Angular 22 practice question
During server-side rendering, an Angular 22 app uses HttpClient with the default fetch backend to download a 2.5 MB JSON catalog from an API, and the request fails. What caused the failure?
Check answer and explanation
Correct answer: Angular caps each SSR HttpClient fetch response body at 1 MB by default and throws error NG02825 when exceeded.
Explanation
When HttpClient uses the default fetch backend during SSR, Angular caps each response body at 1 MB by default and fails with error NG02825 if a response exceeds that size.
Common trap
Assuming the fetch backend cannot parse JSON during SSR is a tempting guess when requests fail on the server, but fetch is the default SSR backend and handles JSON normally within size limits. Blaming a 256 KB TransferState cap sounds plausible because TransferState serializes data into HTML, yet the actual default limit is 1 MB on the response body itself.
Source: Angular docs: Server and hybrid rendering — Configuring the response body size limit
Checked against the cited text on 2026-11-25.