-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed
Labels
area: common/httpIssues related to HTTP and HTTP ClientIssues related to HTTP and HTTP Clientarea: serverIssues related to server-side renderingIssues related to server-side rendering
Milestone
Description
🐞 Bug report
What modules are related to this issue?
- builders
- common
- express-engine
Is this a regression?
Yes, the previous version in which this bug was not present was:
13.2.0
Description
I'm trying in a lazy module to execute an HTTP Request. The HTTP Request is executed on the server platform, and the value is set to the TransferState, but the data which should be in a script at the end of the document is not present. Consequently, on the browser platform, the same HTTP Request is executed once more. The same script works on a non-loaded lazy module.
🔬 Minimal Reproduction
- Create a blank repository:
ng new test - Add Angular Universal:
ng add @nguniversal/express-engine - Create a lazy module with
RouterModuleand addHttpClientModuleinto it. - Check if the
TransferStatehasStateKey, if yes, retrieve withTransferState.get, else make theHTTP RequestandTransferState.setthe response.
A reproduction of the issue is here: https://github.com/GeorgeHulpoi/angular-universal-transfer-state-issue
🌍 Your Environment
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 15.0.4
Node: 16.17.0
Package Manager: npm 9.2.0
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1500.4 (cli-only)
@angular-devkit/core 15.0.4 (cli-only)
@angular-devkit/schematics 15.0.4 (cli-only)
@schematics/angular 15.0.4 (cli-only)
Metadata
Metadata
Assignees
Labels
area: common/httpIssues related to HTTP and HTTP ClientIssues related to HTTP and HTTP Clientarea: serverIssues related to server-side renderingIssues related to server-side rendering