Better error log for: "No .NET call dispatcher has been set."

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I have added sentry to my website and i notice there are some errors with “No .NET call dispatcher has been set.”. But i do not have the same issue locally and based on the exception (stack trace) i wasn’t able to resolve this issue. The only hint is that it is happening only on iOS devices so far.

Stack trace

Error: No .NET call dispatcher has been set.
  at w(/_framework/blazor.webassembly.js:1:2110)
  at b(/_framework/blazor.webassembly.js:1:1995)
  at ? (/_framework/blazor.webassembly.js:1:60337)
  at asyncFunctionResume([native code])
  at ? (/_framework/blazor.webassembly.js:1:28875)
  at asyncFunctionResume([native code])
  at ? (/_framework/blazor.webassembly.js:1:27678)
  at asyncFunctionResume([native code])
  at ? (/_framework/blazor.webassembly.js:1:28990)
  at asyncFunctionResume([native code])

Describe the solution you’d like

It would be nice if there was some hint in error message which make debugging easier.

Additional context

No response

Issue Analytics

  • State:open
  • Created 4 months ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
javiercncommented, May 10, 2023

@jirisykora83 sorry, my English broke 😄.

Avoid running things that interact with JS or Blazor state from background threads, and so on.

Blazor uses a synchronization context and things like ConfigureAwait break it.

0reactions
jirisykora83commented, May 10, 2023

I already deploy ‘fix’ where i try to remove ConfigureAwait (i hope i do not miss anything). But I still see the error in sentry. Is there anything else what could cause it? Or is there something that I can do to get more information about the error (without access to real devices where error happen)?

From what i know it is only happened on iOS devices

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript Interop - No .NET call dispatcher has been set ...
html means, that the script is executed before your wasm app is loaded. To solve the issue, it is a good practice to...
Read more >
Blazor: No .NET call dispatcher has been set · Issue #14965
Describe the bug When creating a Blazor server-side app, it is not possible to call DotNet.invokeMethodAsync from HTML JavaScript.
Read more >
Calling .NET From JavaScript
Blazor enables us to asynchronously call methods on instances of objects, or static methods on classes.
Read more >
Guide to Blazor JavaScript Interop - Imaginet Blog
Learn how to use Blazor JavaScript Interop to make JavaScript and .NET code interact seamlessly. Get up and running quickly with step-by-step..
Read more >
Using JavaScript Interop in Blazor
In this post, I show how you can interact with the JavaScript world from Razor Components and Blazor applications.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found