-
Notifications
You must be signed in to change notification settings - Fork 11
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
Could not find 'Toolbelt.Head.Title.query' ('Toolbelt' was undefined). #20
Comments
i fix it
I had to add it manually to the project, nuget refused to download this version for me. The next problem is that I have a blank page, nothing renders. No html tag (empty in source) Console log:
|
@Alerinos Thanks for reporting. I tried to reproduce your problem on my hand, but unfortunately, I couldn't. So to isolate the cause of the problem, could you try to comment out "app.UseHeadElementServerPrerendering()" and rerun it, and let me know if you still get an empty response? Or, I welcome you to zip & attach the whole project that can reproduce the problem to this thread. |
At the moment of commenting, the page works, the content is rendered, but the title is not changed. The title is hidden in the source of the page. At the time of uncommenting, the site also works until I put <title> My project is like a library, blazor server page is running by another project. It is also a migration from Razor Pages. Will try to create a new project and see if it works. |
Found a bug, add this:
|
BlazorToolbeltTest.zip |
@Alerinos Thanks for your cooperation. 👍 I could reproduce the problem, and I could find the reason for the problem. Currently your code is like this: app.UseHeadElementServerPrerendering();
app.UseResponseCompression();
app.UseHttpsRedirection();
app.UseStaticFiles(); Could you try to change the code above to below? app.UseResponseCompression();
app.UseHttpsRedirection();
app.UseHeadElementServerPrerendering(); // 👈 Place this just before `UseStaticFile()`
app.UseStaticFiles(); The But if the |
I did, and it only works for server rendering. Blazor has a rendering problem. The problem seems to me to be running it from another project. (See zip package above). Another problem I see is when we do this:
The server takes a long time to render the content. The more tags, the longer the server response. Maybe a loop? Use this and test the times. Something is wrong, the server renders for a long time.
16:01:52-16:02:09 It took 17 seconds to render the page.
|
I could not reproduce the "the server takes a long time to render the content" problem on the BlazorToolbelt.zip.
I have no idea at this time that this problem is caused by "HeadElement" or not. |
I just did a test on "BlazorToolbelt.zip", I have no idea why I'm having such a long time. I am using Microsoft Edg. On Google Chrome it is 5.4 seconds. I also use Visual Studio 2022 windows 11. My CPU is ryzen 9 3900xt and the NVME disk so it shouldn't be a problem. I just did a debug to release test, the time dropped from 8 seconds to 4 but that may be the case. |
Hi, did you find the problem? |
Sorry too late.
I still can't reproduce this problem. 📂 BlazorToolbeltTest - Aug 29, 2021 - J.Sakamoto.zip If you can't reproduce that problem with the project that I attached, the reason for the problem will not be the "Head Element Helper" library, I think.
Your fault will cause this problem. You must use the "Sdk=Microsoft.NET.Sdk.Web" instead of the "Sdk=Microsoft.NET.Sdk" to create an ASP.NET Core project, especially in the case that the project reference other ASP.NET Core web or component projects. If you don't do that, it will not work fine not only in the "Head Element Helper" library but any NuGet Packages that include JavaScript code. The project that I attached to this post above is modified at this point, and that project works fine. |
Thanks it works, I thought the main project didn't need to have this.
Still the same problem, how can i help you? How can I take a memory or program dump? BlazorToolbeltTest.zip |
There is another way to do this? Unfortunately my main project runs other projects (SignalR, RestAPI, Bot etc). After switching to Web, the console application does not work for me. :( |
Could you explain in more detail what happened? There is nothing that I can do because the hint is only "doesn't work". By the way, is your project that includes this problem hosted in any Git repository cloud services like GitHub? Please consider it. |
I have this problem, I'm using Core 6 preview Blazor server
The text was updated successfully, but these errors were encountered: