-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Server side rendering does not complete; I'm left with html with the placeholders and no functionality. #13771
Comments
Thanks for contacting us. |
The repo is a minimalistic repro; What issue are you having with debug? I don't need help debugging the app, just understanding why it never gets rendered. Browser dev tools show that blazor.server.js is getting loaded. |
I've got a similar issue since switching to Preview 9. I've followed the steps in Dan's blog post to upgrade to Preview 9 and I'm now getting this behaviour: My solution is comprised of:
If I set the startup project to the Blazor project all is well and all the Blazor components work correctly. If I set the startup project to the MVC project and use this syntax to render the component:
I get the following results:
The placeholder looks like this:
What's weird is that I have no compiler errors and no console errors Like @MarkStega I can see from Chrome's DevTools that blazor.server.js is loaded in the _framework folder. My console shows:
|
Spent some time, but found a solution that worked for me: Just copied _Imports.razor to my project (with changes in namespaces), and used the code from _Host.html to render my Blazor component. P.S. Still disapointed by the fact I cannot pass parameters to it anymore. |
@JonasGo4 found the issue; Up until P9 the following snippet of code in _Host.cshtml worked:
I just added the @(await snippet into the app . The issue is the placement of the script includes; Changing to
resolves the issue |
@JonasGo4's solution fixed it for me too. In my case I needed to move the scripts in the _Layout.cs file to after <div class="am-content">
@RenderBody()
</div>
<partial name="_RightSideNavPartial" />
</div>
@* this must be after the rendering of the Blazor component on the page *@
<script src="_framework/blazor.server.js"></script> |
Thanks for contacting us. We believe that the question you've raised have been answered. If you still feel a need to continue the discussion, feel free to reopen it and add your comments. |
Describe the bug
I have migrated my application to Preview 9. When it executes client side it all works. When executing server side with a Render mode of Server or ServerPrerendered I get no interactivity with my component. With Server I end up seeing the placeholder in the html with an empty browser window, with ServerPrerendered I do see the opening page of my app, but the prerender placeholder is still in the html.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'd expect that server-side runs would work just as client side does..
Screenshots
n/a
Additional context
The text was updated successfully, but these errors were encountered: