Skip to content
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

<Link> creates forece reload #35

Open
Alerinos opened this issue Oct 4, 2022 · 4 comments
Open

<Link> creates forece reload #35

Alerinos opened this issue Oct 4, 2022 · 4 comments

Comments

@Alerinos
Copy link

Alerinos commented Oct 4, 2022

Using this method causes a heavy reload of the page:

@using Toolbelt.Blazor.HeadElement
<Link Rel="canonical" Href="https://google.pl" />

The problem is described here:
dotnet/aspnetcore#15317

What's the problem?
In the case of server side rendering, blazor loads the page content and then the async elements are reloaded.
This gives us the effect of double page loading.

Only Link has a problem, meta tags work well.

Demo:
https://gyazo.com/b36e3ea01ebeefb56e60b524b3b24532

If I don't use or _headElementHelper.SetLinkElementsAsync then the problem disappears.

@jsakamoto
Copy link
Owner

@Alerinos
Thank you for reporting!

Unfortunately, I could not reproduce the force reloading that you said yet.

My sample project is here:

📦LinkCanonicalTest.zip

image

Could you take a look at my sample project above?

@Alerinos
Copy link
Author

Alerinos commented Oct 5, 2022

I tried to open an issue on the project you submitted. I failed to.
It looks like my project uses something that has a dependency on your library.
I will try to find a solution and a bug.
It is possible that the problem occurs with more data and tags in Head

Once I noticed that something like this happens when you load static files (pictures, background, more css etc).
Also now I can see that it is not reloading the files (network). The page just flashes. I think it has to do with the asynchronous solution.

@Alerinos
Copy link
Author

Alerinos commented Nov 9, 2022

I am currently researching this issue. It still exists. This looks like a similar scenario that is in the documentation.
https://learn.microsoft.com/en-us/aspnet/core/blazor/components/lifecycle?view=aspnetcore-7.0

@jsakamoto Can you look at the code again? Maybe you missed something. Thanks!

@jsakamoto
Copy link
Owner

@drma-dev Sorry too late since I was busy watching the .NET Conf 2022 that was held this week. (I live in Japan, so I had to wake up at midnight in the Japan Standard Time zone and keep staying up).

Can you look at the code again?

Ok, but I don't have the confidence to resolve this issue as far as I've gotten limited information below:

  • The page is flushing. (Not reloading)
  • It seems involve with the <Link Rel="canonical" Href="https://google.pl" />

Could you disclose the source code of the app that has the problem we are discussing in this thread?
Or else, can you create and send me a minimal sample project that can reproduce the same problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants