I deployed to Azure Static Web Apps the default app that comes whenever you create a new Blazor WebAssembly app via dotnet new blazorwasm
. At first it works properly but when I added webpack to build my SASS file, it showed me this error once it gets deployed to Azure SWA that says:
Refused to apply style from <URL> because its MIME type ('text/html') is not a supported stylesheet MIME type
on the Blazor generated CSS file and the _framework/blazor.webassembly.js
file; which is interesting given that those files are supposed to be the default files Blazor generates.
Also the MIME type as viewed on the dev tools shows incorrectly for these two files, but they used to have correct MIME types before I added webpack.
The webpack-generated CSS file is successfully created and can be viewed on the browser. Also I tested the dotnet publish
version of the app using the SWA cli/emulator and I didn't encounter the error.