Servicestack integration with Blazor Razor Class Library

40 Views Asked by At

I'm trying to integrate the new .net 8 Blazor Server template from ServiceStack into a project that references a Razor Class Library where all the UI assets are located.

Once I copy over the razor files to the RCL and fix all my references then it all compiles fine and runs, but the screen is always empty. (I'm using the standard SS Blazor Server template - based as asp.net identity auth)

Eventually I will see the following errors in the web dev tools.

enter image description here

Anyone perhaps knows how to integrate this with RCL's. My reason to use RCL's is because I would like to reference them from Blazor Hybrid MAUI. So, the idea is to centralize all UI assets in one project.

With all the custom files ( *.mjs ) and Servicestack.Blazor.html this does not look like an easy integration.

Thanks in advance.

1

There are 1 best solutions below

0
mythz On

Note: it's not clear which ServiceStack Blazor templates you're referring to?

With all the custom files ( *.mjs ) and Servicestack.Blazor.html this does not look like an easy integration.

The *.mjs are normal JavaScript modules loaded directly by the Browser and Servicestack.Blazor.html is an inert html file that's only used by the external tailwindcss process to include additional classes in its compiled app.css, none of these should have any impact with Blazor component integration.

You should look at what's causing the error message, e.g. you have a syntax error which sounds like you're trying to load either a JavaScript module or TypeScript file as a normal JavaScript script.

The missing loadTimeData function is also not a function in ServiceStack, so it's likely the integration you're trying to add is not properly configured.