MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Error: WebView2: Initialization failed due to incompatible environment configurations.

Open
#4,174 5 comments 1 reaction 1 assignee 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?

Hi,

I'm currently facing an issue where I consistently specify the same options for my environment configuration. However, in a few rare cases , I encounter the following error in my output window:
WebView2: Initialization failed due to incompatible environment configurations. Please check if there is already a WebView2 running with the same user data folder but different environment parameters.

In CreateCoreWebView2Controller handler I get the error code ERROR_INVALID_STATE:
"The group or resource is not in the correct state to perform the requested operation. (0x8007139f)"

I'm unsure why this inconsistency is happening despite consistently specifying the same options. If I use one profile folder for each webview, everything works (for my scenario at least)

Edit:
I also try:
to alternate between two profile folders, and everything works.
to put a Sleep(50) before CreateCoreWebView2Controller If the time elapsed since the last call to CreateCoreWebView2Controller (for all WebView) is less than 50 ms, and everything works. 50 ms is arbitrary.

Could you provide guidance on how to identify and resolve this issue?

Thank you.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

119.0.2151.44

SDK Version

1.0.2151.40

Framework

Win32

Operating System

Windows 10

OS Version

19044.2075

Repro steps

It will be hard to give exact repros steps, here my setup

  • Fixed version
  • Multiple WebView creation/deletion (7)
  • Using the same folder and identical options (to the best of my knowledge)
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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.