blazor-components
blazor-components copied to clipboard
InvalidOperationException: No JavaScript runtime found.
While everything works fine locally using both Debug and Release configuration, after using published app error InvalidOperationException: No JavaScript runtime found. appeares.
I am using .NET 6 and Typeahead component.
I suspect this is caused by .NET 6 trimming. Default settings are that "removes unused members from types". Since GetJSRuntime uses reflection to get JSRuntime trimmer can not see that JSRuntime property is used and removed it.
Disabled trimming solved this issue for me, but is not suitable as long term solution.