Blazor Static Web App Hosting Issue

Daniel Brown 0 Reputation points
2026-08-28T08:50:12.8466667+00:00

When my static web app is hosted on azure I am getting this error in the browser when I try to visit the website. Is there a way to fix this?

Tracking Prevention blocked access to storage for https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css.

(index):1 Tracking Prevention blocked access to storage for https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css.

(index):1 Tracking Prevention blocked access to storage for https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css.

(index):1 Tracking Prevention blocked access to storage for https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css.

dotnet.js:1 Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

blazor.webassembly.w3qd1tpl0e.js:1 Uncaught (in promise) Error: Failed to start platform. Reason: TypeError: Failed to fetch dynamically imported module: https://agreeable-field-000682b0f.7.azurestaticapps.net/_framework/dotnet.js

at Zt (blazor.webassembly.w3qd1tpl0e.js:1:58780)

(index):1 The resource https://agreeable-field-000682b0f.7.azurestaticapps.net/_framework/dotnet.pr706vb2z5.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

(index):1 The resource https://agreeable-field-000682b0f.7.azurestaticapps.net/_framework/dotnet.pr706vb2z5.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

Azure Static Web Apps
Azure Static Web Apps

An Azure service that provides streamlined full-stack web app development.


1 answer

Sort by: Most helpful
  1. Allan Solomon Mejia 6,880 Reputation points
    2026-08-28T16:11:37.18+00:00

    Hello @Daniel Brown

    The key error here is: "Failed to load module script ... server responded with a MIME type of "text/html"

    followed by the failure to load: /_framework/dotnet.js

    This usually means dotnet.js isn't being served from the deployed Blazor WebAssembly output. Instead, Azure Static Web Apps is returning index.html for that request, so the browser receives text/html where it expects JavaScript/WASM. The Bootstrap tracking-prevention messages are unrelated to the Blazor startup failure.

    Check the deployment first.

    For a standalone Blazor WebAssembly application, Microsoft states that the published static site comes from the application's published wwwroot directory. That output should contain index.html and the _framework directory with the Blazor runtime assets.

    After publishing locally, check:

    bin/Release/<target-framework>/publish/wwwroot/
      index.html
        _framework/
           dotnet.js
           blazor.webassembly.js
           ...
    

    Then verify your Static Web Apps workflow's app_location and output_location. A common cause is deploying the project/source directory or the wrong build-output directory instead of the actual Blazor publish output.

    Also check wwwroot/index.html. If the application is hosted at the root of the azurestaticapps.net site, the Blazor base path should normally be:

    <base href="/" />
    

    An incorrect base path can cause _framework requests to be made against the wrong URL. Microsoft documents that standalone Blazor WebAssembly apps hosted at the root normally use / as their base path.

    For Azure Static Web Apps, Microsoft also recommends a staticwebapp.config.json containing the navigation fallback:

    {
      "navigationFallback": {
        "rewrite": "/index.html"
      }
    }
    

    However, the fallback doesn't replace the _framework files. If /_framework/dotnet.js doesn't exist in the deployed artifact, the fallback can cause index.html to be returned instead—which produces exactly the MIME-type error you're seeing. Azure documents that navigationFallback can rewrite unmatched requests to index.html.

    As a quick confirmation, open this directly in the browser:

    https://<your-app>.azurestaticapps.net/_framework/dotnet.js

    If you see an HTML page instead of JavaScript, the _framework deployment/path is the issue.

    So, focus on the Blazor publish output and Static Web Apps deployment paths, not the browser's Tracking Prevention messages.

    Microsoft references:

    Host Blazor WebAssembly with Azure Static Web Apps

    Blazor WebAssembly hosting and deployment

    Azure Static Web Apps configuration

    Help make this community better for everyone: if this answer resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.