Blazor wasm gives "TypeError: Failed to fetch"

When following the Auth0 tutorial for Blazor wasm, I get the following error in the console when my blazor app starts up:

Debugging hotkey: Shift+Alt+D (when application has focus)
blazor.webassembly.js:1 blazor Loaded 8.68 MB resourcesThis application was built with linking (tree shaking) disabled. Published applications will be significantly smaller.
blazor.webassembly.js:1 TypeError: Failed to fetch
    at <anonymous>:1:876
    at Function.<anonymous> (blazor.webassembly.js:1)
    at blazor.webassembly.js:1
    at (blazor.webassembly.js:1)
    at blazor.webassembly.js:1
    at new Promise (<anonymous>)
    at r (blazor.webassembly.js:1)
    at Function.e.initAsync (blazor.webassembly.js:1)
    at blazor.webassembly.js:1
    at blazor.webassembly.js:1
(anonymous) @ blazor.webassembly.js:1
Promise.catch (async)
(anonymous) @ blazor.webassembly.js:1
n @ blazor.webassembly.js:1
(anonymous) @ blazor.webassembly.js:1
(anonymous) @ blazor.webassembly.js:1
blazor.webassembly.js:1 info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[1]
      Authorization was successful.

Strangely, the app still works and I can login just fine (see last line), but the error is a bit worrying. Anyone got any idea why it’s there, and if we can fix/suppress it somehow?

It’s worth noting that it’s definitely the authorization code that’s causing this. If I remove it, it works fine again (particularly the cascading and authorize view code in the App.Razor file).

I have the same issue with openid connect,
Looks like it was being failed when trying to fetch _framework/blazor.boot.json
Somehow there is the conflict when blazor start up, but I still dont know how to fix it :frowning:

1 Like