Questions tagged [angular-transfer-state]
20 questions
7
votes
1 answer
send token to server in angular universal
I have an Angular 6+ app which is configured to utilize server side rendering using Angular Universal.
I also used TransferState to avoid duplicate API calls on the server and client app.
Authentication in my angular app is based on token.
The…

Fartab
- 4,725
- 2
- 26
- 39
4
votes
1 answer
ERROR NullInjectorError: R3InjectorError(AppModule)[InjectionToken HTTP_INTERCEPTORS->[object Object]->TransferState-> TransferState -> TransferState]
Error Image:-
Error Images
I am facing this issue:
ERROR NullInjectorError: R3InjectorError(AppModule)[InjectionToken HTTP_INTERCEPTORS -> [object Object] -> TransferState -> TransferState -> TransferState]:
NullInjectorError: No provider for…

roman regins
- 43
- 3
4
votes
0 answers
Ignoring BEFORE_APP_SERIALIZED Exception: TypeError: Converting circular structure to JSON
I have an Angular application that uses Angular Universal to do Server Side Rendering, and the TransferState module to pass the state of the application from the server to the client.
I get this warning log on certain pages:
Ignoring…

RTYX
- 1,244
- 1
- 14
- 32
4
votes
1 answer
TransferState: Who guarantees that data is already stored in state?
I'm doing SSR with TransferState and
wondering who guarantees that when we do
http.get(...).subscribe(data => {
transferState.set(DATA_KEY, data)
})
data will be stored in transferState?
Because http.get is async operation and content could be…

Stepan Suvorov
- 25,118
- 26
- 108
- 176
3
votes
0 answers
Angular universal duplicates failed request
I am using Angular Universal with Angular 10. I've imported ServerTransferStateModule into my AppServerModule and TransferHttpCacheModule into my AppModule.
Everything works well, but if the initial request fails with some error (404, 500), it's…

Wataniya Tahrir
- 73
- 5
3
votes
3 answers
How to use HTTP Transfer State when using relative URLs
I am trying to implement built-in TransferHttpCacheModule in order to de-duplicate requests. I am using this interceptor in my app:
intercept(req: HttpRequest, next: HttpHandler): Observable> {
const authService =…

Guerric P
- 30,447
- 6
- 48
- 86
2
votes
0 answers
Angular Universal - Several instances of the script injected by TransferState ()
I have an Angular 7 application with Angular Universal implemented. It's a pretty big application with several lazy loaded modules. I use the TransferState module, and everything goes well, eeeeexcept that in some pages, the script injected by the…

RTYX
- 1,244
- 1
- 14
- 32
1
vote
1 answer
Angular SSR transferState.get(key, null) returns null while I can see objets if logged (both in in browser)
On the angular application I am working on there is a noticeable flicker if the browser simulates a mid-tier mobile. It seems that angular is not doing Dom rehydration when the application changes from Server to Browser, it's fully replacing the…

Chris
- 704
- 1
- 11
- 32
1
vote
1 answer
Spartacus state transfer implementation
I installed SSR to Spartacus application with schematics command and run the application in SSR mode.
In my Chrome dev tools, I can see that content of my homepage was successfully generated by the SSR server.
However, I can see in my network tab,…

hazoja
- 11
- 2
1
vote
2 answers
angular Transferstate prerendered twice - 2 app-state Script tags in html and 2x prerendered by angular comment
I am running angular Universal with Prerendering. When prerendering, i get 2 Angular prerender script Tags, but not always. In my developement environment I had 10 routes prerendered and 7 out of 10 times it had 2 app-state script tags. On the…

Jeremias Nater
- 650
- 3
- 18
1
vote
1 answer
Angular Universal with Contentful and TransferState
I am having some real issue with contentful and angular universal. I have tried so many things to try to get the content to load and be rendered in View Page Source but everything I have tried has failed.
The closest I have got is with using the…

r3plica
- 13,017
- 23
- 128
- 290
1
vote
1 answer
Angular reset TransferState data on route change
I'm using Angular with server-side rendering and TransferState to transfer http data from server to browser. Here is my code:
getProducts() {
let products = this.tstate.get(PRODUCT_KEY, null as any);
if (products) {
return…

Vahid Najafi
- 4,654
- 11
- 43
- 88
1
vote
0 answers
how does Angular HttpInterceptor get called?
I'm trying to understand some code here:
transfer_http.ts
I'm trying to understand how it invalidates the cache:
// Stop using the cache if there is a mutating call.
if (req.method !== 'GET' && req.method !== 'HEAD') {
this.isCacheActive =…

Rusty Rob
- 16,489
- 8
- 100
- 116
0
votes
1 answer
Angular Universal TransferHttpCacheModule is not working inside a route on router navigation, only after reload
I have an Universal app with TransferHttpCacheModule addet to app.module.ts like that:
@NgModule({
...
imports: [
BrowserModule,
TransferHttpCacheModule,
AppRoutingModule,
],
providers: [{ provide: APP_ID, useValue: 'serverApp'…

ufollettu
- 822
- 3
- 19
- 45
0
votes
0 answers
Angular transfer state implicitly include component state - when I explicitly only provide it page data?
I am currently trying to work out an issue I currently have with transferState, and that it tries to serilize app component, when what I provide it is the json data provided from the backend.
this._httpClient
.get(fullUrl)
…

I am not Fat
- 283
- 11
- 36