wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
24.58k stars 1.18k forks source link

WebVie2wProcess failed with kind 0 when use OpenFileDialog #3770

Closed fcying closed 1 hour ago

fcying commented 2 hours ago

Description

when I use runtime.OpenFileDialog, WebView2 crash

ERR | WebVie2wProcess failed with kind 0
[0923/141038.774:ERROR:window_impl.cc(119)] Failed to unregister class Chrome_WidgetWin_0. Error = 0

To Reproduce

  1. wails init -t vue-ts -n wails
  2. update Greet function
    func (a *App) Greet(name string) string {
    options := runtime.OpenDialogOptions{}
    file, _ := runtime.OpenFileDialog(a.ctx, options)
    return file
    }
  3. wails dev
  4. click Greet, select file, open

Expected behaviour

work fine.

Screenshots

PixPin_2024-09-23_14-13-23

Attempted Fixes

No response

System Details

# Wails
Version | v2.9.2

# System
┌───────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                             |
| Version      | 2009 (Build: 19045)                                        |
| ID           | 22H2                                                       |
| Go Version   | go1.22.7                                                   |
| Platform     | windows                                                    |
| Architecture | amd64                                                      |
| CPU          | AMD Ryzen 7 5700X 8-Core Processor                         |
| GPU          | NVIDIA GeForce RTX 3060 Ti (NVIDIA) - Driver: 32.0.15.5612 |
| Memory       | 64GB                                                       |
└───────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 117.0.2045.31 |
| Nodejs     | N/A          | Installed | 22.9.0        |
| npm        | N/A          | Installed | 10.8.3        |
| *upx       | N/A          | Installed | upx 4.2.4     |
| *nsis      | N/A          | Available |               |
└─────────────── * - Optional Dependency ───────────────┘

# Diagnosis
Optional package(s) installation details:
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 SUCCESS  Your system is ready for Wails development!

Additional context

No response

ellis2323 commented 1 hour ago

I have meet a problem with OpenFileDialog after an update of wails. I have updated my go to the last version 1.23 and it works. Please check your webview2 version too. I have repeated your example without problem on my platform.


Version | v2.9.2

# System
┌───────────────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                                                 |
| Version      | 2009 (Build: 19045)                                                            |
| ID           | 22H2                                                                           |
| Go Version   | go1.23.1                                                                       |
| Platform     | windows                                                                        |
| Architecture | amd64                                                                          |
| CPU          | AMD Ryzen 7 5700G with Radeon Graphics                                         |
| GPU          | AMD Radeon RX 7800 XT (Advanced Micro Devices, Inc.) - Driver: 32.0.11027.1003 |
| Memory       | 32GB                                                                           |
└───────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 128.0.2739.79 |
| Nodejs     | N/A          | Installed | 18.20.4       |
| npm        | N/A          | Installed | 10.7.0        |
| *upx       | N/A          | Available |               |
| *nsis      | N/A          | Installed | v3.10         |
└─────────────── * - Optional Dependency ───────────────┘
fcying commented 1 hour ago

Thanks for the reminder~

It has not about with the Go version. I tried both 1.22 and 1.23, and the issue is the same. It's related to the version of Webview2, After updating to the latest version 129.0.2792.52, it worked correctly.