MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: ~1% chance calling native-side code from web-side fails with Error: No parameters in result

Open
#4,881 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

Datadog RUM tracks our WebView2-based application and for ~1% overall calls from web-side to native-side fails with Error: No parameters in result and it may crash the entire UI. We know the error message may come from v8(/third_party/blink/renderer/bindings/modules/v8/v8_post_remote_object_call_sync_results.cc), it provides little information for debugging purpose. As the reproduction rate is low, it's difficult for us to track the cause.

I find it's quite similar to #4497, is it related to the option ignoreMemberNotFoundError?

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

Evergreen

SDK Version

1.0.1418.22, 1.0.2365.46

Framework

WPF

Operating System

Windows 10, Windows 11

OS Version

No response

Repro steps
  1. Create a native class, for example
using System.Runtime.InteropServices;

namespace Foo
{
    [ClassInterface(ClassInterfaceType.None)]
    [ComVisible(true)]
    public sealed class NetworkMonitor : EventListener
    {
        private readonly INetworkMonitorService _networkMonitorService;

        public NetworkMonitor(INetworkMonitorService networkMonitorService)
        {
            _networkMonitorService = networkMonitorService;
            _networkMonitorService.NetworkChanged += OnNetworkChanged;
        }

        private void OnNetworkChanged(object sender, string s)
        {
            DispatchEvent("NetworkChanged", s);
        }

        public bool IsInternetAccess()
        {
            return _networkMonitorService.LastNetworkAvailable;
        }
    }
}
  1. Register it with AddHostObjectToScript
webView.CoreWebView2.AddHostObjectToScript("foo", Singletons.Foo);
  1. Invoke a function of foo right after the page is loaded in WebView2
window.onload = () => {
  console.log(foo.isInternetAccess())
}
  1. For 1% cases, an Error is thrown
Error: No parameters in result: {
 "methodName": "",
 "parameters": null,
 "remoteObjectId": 0
}
  at RemoteMessenger.postSyncRequestMessage @ <anonymous>:1:17256
  at Function.applyHostFunction @ <anonymous>:1:38041
  at Object.apply @ <anonymous>:1:26077
  at Object.apply @ <anonymous>:540:58
Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported WebView2 repro using AddHostObjectToScript and the immediate window.onload call, then inspect the referenced v8_post_remote_object_call_sync_results.cc path. Compare the intermittent result containing a null parameters value with the successful call and the related issue #4497. Done means identifying the failure cause or improving the available debugging information.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, javascript
Domain
desktop, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.