Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] JS exceptions are not propagated to C# when calling DoInvokeAsync methods in WebAssembly #30

Open
Mike-FB opened this issue Nov 29, 2023 · 0 comments
Labels
Bug Something isn't working Triage Issue needs to be triaged

Comments

@Mike-FB
Copy link

Mike-FB commented Nov 29, 2023

Describe the bug
JS exceptions does not get propagated to C# when calling methods such as StartPlayback, Instead they end up as an 'Uncaught (in promise) DOMException'.
This seems to happen due to trying to handle the JS promise synchronously in BlazoredVideo.DoInvokeAsync/DoInvokeAsync when running in WebAssembly. When I pulled down the code and tested with the IJSInProcessObjectReference code removed, the issue seemed to be resolved.

To Reproduce
Steps to reproduce the behavior (In Chrome, as chrome will throw an exception when trying to start unmuted playback without user interaction):

  1. Go to the file 'AllEventsAllOptions.razor' in the project 'SharedRCL' from your own samples.
  2. Add an action to the BlazoredVideo elements CanPlay with the following code await video.StartPlayback();
  3. Start the WebAssembly project without interacting with any content, wait for all content to load.
  4. Open the devtools and look in console. There should be an 'Uncaught (in promise) DOMException'.

Expected behavior
The JSException should be propagated to C# so that it can be handled appropriately.

Screenshots
Example of the uncaught exception:
image

Hosting Model (is this issue happening with a certain hosting model?):

  • Blazor WebAssembly
@Mike-FB Mike-FB added Bug Something isn't working Triage Issue needs to be triaged labels Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant