Skip to content

Blazor, during the first visit, the page loads twice #42400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
Alerinos opened this issue Jun 24, 2022 · 4 comments
Closed
1 task done

Blazor, during the first visit, the page loads twice #42400

Alerinos opened this issue Jun 24, 2022 · 4 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-server ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@Alerinos
Copy link

Alerinos commented Jun 24, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

The problem occurs on the Blazor Server Side. If we enter the website, it loads statically for the first time, everything is fine. Then the next loading is dynamic.
Video: (Test network Fast 3G)
https://www.awesomescreenshot.com/video/9628814?key=df3856b7747e341d4c44c561c7887af2
https://gyazo.com/42990466ec4368bb980f71a65c40c981

During the first charge
image

Then the sida server immediately loads
image

I noticed that in this case there are even 3 page loads ...

This problem occurs everywhere, even in the clean design created by vs.

URL page:
https://instytutkrypto.pl/

What could it be? How to prevent this from happening? I once saw a tutorial on this but only for wasm.

Expected Behavior

The page should load once, not jump.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

.net core 7 preview 5

Anything else?

No response

@yugabe
Copy link

yugabe commented Jun 24, 2022

Once during prerendering, once after. This is by design.

Relevant docs.

@javiercn
Copy link
Member

@Alerinos thanks for contacting us.

This is currently by design. There is an issue to change how this work that can be found here #15317

I would suggest you upvote that issue instead.

@javiercn javiercn added ✔️ Resolution: Duplicate Resolved as a duplicate of another issue area-blazor Includes: Blazor, Razor Components feature-blazor-server labels Jun 24, 2022
@ghost ghost added the Status: Resolved label Jun 24, 2022
@javiercn javiercn closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2022
@Alerinos
Copy link
Author

@yugabe

image
If I set the method not asynchronous, my code will not execute.

@javiercn
I gave a thumbs up. In my opinion, the .net 7 version should be catching up, not creating minimal interfaces and things that are not must-have.

Do you have any idea / method to fix this problem quickly? Unfortunately, I can't call a non-async method.

@javiercn
Copy link
Member

@ghost ghost locked as resolved and limited conversation to collaborators Jul 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-server ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants