Which @angular/* package(s) are the source of the bug?
platform-server
Is this a regression?
No
Description
Due to an application error an unserializable exception object was passed to the TransferState service. This caused the exception below. Unfortunately, the error is being swallowed so the page returns a 200 OK without the transferstate <script id="ng-state" type="application/json"> snippet which in turn caused some issues for our website client-side.
The code containing the error handling is here:
Ideally we have a way of handling this kind of error and produce an error page instead.
A page was returning a 200 OK response in a corrupted state. I noticed that the ng-state script snippet was missing in the response.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
The server logs mentioned following error:
Ignoring BEFORE_APP_SERIALIZED Exception: TypeError: Converting circular structure to JSON
--> starting at object with constructor 'r'
| property 'upload' -> object with constructor 'b'
--- property '_request' closes the circle
at JSON.stringify (<anonymous>)
at e.toJson (file:///app/dist/apps/web/server/chunk-7FR65NHR.mjs:5:31328)
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 20.1.3
Node: 20.19.4
Package Manager: yarn 4.9.2
OS: darwin arm64
Angular: 20.1.3
... animations, build, cdk, cli, common, compiler, compiler-cli
... core, forms, language-service, localize, platform-browser
... platform-browser-dynamic, platform-server, router, ssr
Package Version
------------------------------------------------------
@angular-devkit/architect 0.2001.3
@angular-devkit/core 20.1.3
@angular-devkit/schematics 20.1.3
@schematics/angular 19.0.7
ng-packagr 19.0.1
rxjs 7.8.1
typescript 5.8.3
zone.js 0.15.1
Anything else?
No response
Which @angular/* package(s) are the source of the bug?
platform-server
Is this a regression?
No
Description
Due to an application error an unserializable exception object was passed to the TransferState service. This caused the exception below. Unfortunately, the error is being swallowed so the page returns a 200 OK without the transferstate
<script id="ng-state" type="application/json">snippet which in turn caused some issues for our website client-side.The code containing the error handling is here:
angular/packages/platform-server/src/utils.ts
Line 207 in f35b2ef
Ideally we have a way of handling this kind of error and produce an error page instead.
A page was returning a 200 OK response in a corrupted state. I noticed that the
ng-statescript snippet was missing in the response.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