1

I can only prerender a component razor into a .cshtml page if it is entered in the client.

<component type="typeof(MyApp.Client.Pages.Counter)" render-mode="WebAssemblyPrerendered" />

Why if I move mycomponent.razor to the server I can't use it?

<component type="typeof(MyApp.Server.Pages.Counter)" render-mode="ServerPrerendered" />

Thanks

Pippo LoVe
  • 13
  • 4
  • 2
    What do you mean "to the server", do you mean on Blazor Server? If yes, the [Doc](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/prerendering-and-integration?view=aspnetcore-6.0&pivots=server) seems to say that you should use `ServerPrerendered` instead of `WebAssemblyPrerendered`. – T.Trassoudaine Mar 29 '22 at 14:30
  • 1
    It is a WebAssembly Hosted project which has the Client and the Server. I followed the directions of the Doc and the browesr console returns this error: Error: The circuit failed to initialize. blazor.server.js – Pippo LoVe Mar 30 '22 at 17:38

0 Answers0