Forum Discussion

DarioGalvani's avatar
DarioGalvani
Copper Contributor
May 13, 2024

Blazor - WebAssembly .. OnInitializedAsync run twice

I'm having trouble with OnInitializedAsync. I have a BLAZOR webassembly app when a page is called I see OnInitializedAsync runs twice.... this happens on the dev machine. 

Is this standard behaviour with WASM on dev machine? 

If I check the deployed app with edge (f12) I see 1 call ( Why?)

Can anyone give me more info about this behaviour? 

I googled a lot ... everywhere they talk about server and wasm in the same way...

I'm goin crazy.It makes me confused and stunned.

 

I've found a working workaround with a variable to manage if that is the first or the second execution.

 

I hope someone can help me or give me info.

TIA 

Dario

No RepliesBe the first to reply