servicetitan / Stl.Fusion.Samples

A collection of samples for Fusion library: https://github.com/servicetitan/Stl.Fusion
MIT License
163 stars 33 forks source link

Update error: Endpoint not found: 'ICounterService.Get:1'. #28

Closed d-pollard closed 1 year ago

d-pollard commented 1 year ago

When I run HelloBlazorHybrid, the Blazor Server works as expected. However, when I switch to Blazor WASM, I get errors that look like this:

Update error: Endpoint not found: 'ICounterService.Get:1'.

Is this a bug? Am I missing some build step maybe?

Thank you for taking the time to read this, and I appreciate the work on the library! <3

Screenshot 2023-08-16 at 2 59 09 PM

alexyakunin commented 1 year ago

Got it, probably forgot to register the client in WASM :)

alexyakunin commented 1 year ago

Will fix it today or so, thanks for the report!

alexyakunin commented 1 year ago

@d-pollard it's resolved. Unfortunately, the changes were mixed up with changes related to migration to Fusion v6.1.13 (all BlazorMode*-related things + package version updates), so here is the delta related to this issue:

  1. services.AddFusion() was used w/o RpcServiceMode.Server - once this option is used, every .AddService call also shares the service via RPC, i.e. makes it a server. You can use .AddServer instead, but this is kinda more convenient. https://github.com/servicetitan/Stl.Fusion.Samples/commit/f5ae59e4a573d2e8c082b5ffaf1e26145bd15661#diff-09eb8bedf3ebab82f7367f1e38009cd96d8da48cd40d1c891d4ceb962f6f61a2R53

  2. WeatherForecast type wasn't MemoryPack-serializable: https://github.com/servicetitan/Stl.Fusion.Samples/commit/f5ae59e4a573d2e8c082b5ffaf1e26145bd15661#diff-2514fd9fe4584a13396da114447a08afbc4e38b68d10db06158f1acea74ca51d

d-pollard commented 1 year ago

@alexyakunin thank you for the quick response! I'm trying to learn Stl.Fusion; I'm a senior React engineer and am tired of solving the same realtime/cache/state issues over and over. I'm hoping these samples will help me move to a more robust (and feature complete) solution!