-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Better dev. experience when AddServerRenderMode
or AddWebAssemblyRenderMode
is missing
#49312
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
Comments
@SteveSandersonMS Is this really the same issue as #49303? |
@danroth27 The issue is that the
@javiercn Now we support callsite rendermodes we can't rely on statically detecting rendermodes. Do you have a preference on how to handle this? I'd recommend we change the source generator not to try doing static detection since that can't be reliable, and instead register the endpoints:
What do you think? |
Well adding
Adding Also ToggleNavMenu button doesn't work without adding |
Commented in a different issue that was closed out for updates coming in Preview 7, but to @AmarjeetBanwait's comment I'm not able to get interactivity working any combination of those. Is there a current working sample I can view that demonstrates the interactivity in Preview 6? |
@Dulatr Did you try creating a Blazor Web App using the new template and selecting the "Use interactive server components" option? That should enable interactivity for the Counter component. If you want to see how to enable interactivity for the entire app using Blazor Server see https://github.com/danroth27/Net8BlazorServer. |
@danroth27 Thank you for that. Your repo provided solved my problem exactly. A combination of the |
@mkArtakMSFT @javiercn @danroth27 I'm pinging everyone again (and changing labels so this comes up in triage) because it seems we still don't have any plan to address this. I did raise this repeatedly during API review but didn't get any traction on us solving it. Today one of the team's engineers burned quite a bit of time not understanding why interactive rendering wasn't working, and in the end it was because of not having I think the options are:
|
I can repro this issue on the latest .NET8.0 RC1 build with following steps:
Result: In my Program.cs file contain the My Repro solution here https://github.com/jinzhao1127/BlazorWebServerApp.git |
@jinzhao1127 You have to mark component subtrees as interactive if you want them to be. For example, at the top of @attribute [RenderModeServer] In the final version of .NET 8, this will be changed to |
@SteveSandersonMS Thanks, After adding |
When I follow the same steps as Jin's comment in Blazor Web App for WASM project, the "Do Something" button is not interactive. So I try to add |
Just to confirm what @EmilyFeng97 reports: I tried the exact same yesterday with .NET 8 preview 7, and got the same error. Just didn't found the time to report the bug yet. But +1 from me that it is reproducible, would love to know if there is a workaround. |
@EmilyFeng97 Enabling WebAssembly is different from enabling Server. For WebAssembly you have to have a separate, WebAssembly-specific project, since it has to compile in a different way. Please see the project templates in RC1 which have options for enabling Server or WebAssembly interactivity (or both). |
AddServerRenderMode
or AddWebAssemblyRenderMode
is missing
Done in #50311 |
I'm trying to upgrade a Blazor Server app to .NET 8 using the new full stack web UI model. I've setup the Blazor
Router
component to render using the server interactive render mode, but the rendered pages (like the counter) don't render interactively.Repro steps:
Expected result: The counter works
Actual result: The counter doesn't increment when clicked
The text was updated successfully, but these errors were encountered: