I am using MatBlazor 2.6.0 in a server side blazor project. I did the following steps:
- Added MatBlazor to the project (2.6.0)
- Included
@Using MatBlazor
in my _Imports.razor file - Added the static file to _Hosts.cshtml
When I run the project I get an error:
Microsoft.JSInterop.JSException: Could not find 'matBlazor' in 'window'.
When I check the view source in the browser, I see there is a reference:
<script src="_content/MatBlazor/dist/matBlazor.js"></script>
But when I check the contents of that .js file it is empty, any idea on what I could be doing wrong here?
I had to change the ASPNETCORE_ENVIRONMENT environment variable from "Local" to "Development" and it magically started working... still looking for why.
see https://github.com/SamProf/MatBlazor/issues/375#issuecomment-852946500 for details