🐞 Bug report
What modules are related to this issue?
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
RouterModule and add HttpClientModule into it.
- Check if the
TransferState has StateKey, if yes, retrieve with TransferState.get, else make the HTTP Request and TransferState.set the 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)
🐞 Bug report
What modules are related to this issue?
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 ascriptat 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
ng new testng add @nguniversal/express-engineRouterModuleand addHttpClientModuleinto it.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