wailsapp / wails

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

OpenFileDialog Call Crashes Application #3726

Closed CaptainFallaway closed 1 week ago

CaptainFallaway commented 1 week ago

Description

I'm making a project where a file needs to be loaded and I'm using runtime.OpenFileDialog and when my frontend calls my OpenFileDialog function bound to my app interface it just crashes and gives me a long error that I myself cannot debug nor understand at all.

I am developing this application on two devices one running debian trixie with go version 1.23 and the other running windows 11 with go 1.23. On my linux installation it works with no problems but when I run the exact same source code on my windows device it dumps me this long error that I'll post below in a pastebin.

https://pastebin.com/uDnayxFc

I should also mention that I'm using Wails version 2.9.1 and when I run the exact same code in go version 1.22.6 it just works...

To Reproduce

Run windows 11 23H2

  1. Clone my XDH application from github (sorry not sorry)
  2. Run with wails dev (wails ver 2.9.1 & go ver 1.23)
  3. Click on the 'Open File' button on the top right

Or just use the runtime.OpenFileDialog function with these options:

var dialogOptions = runtime.OpenDialogOptions{
    ShowHiddenFiles: true,
    Filters: []runtime.FileFilter{
        {
            DisplayName: "Excel or Csv files",
            Pattern:     "*.xlsx;*.xls;*.csv",
        },
    },
}

Expected behaviour

The runtime.OpenFileDialog should open the windows explorer dialog window so that the user of my application can select a file.

Screenshots

No response

Attempted Fixes

Run with go version 1.22.6 installed and wails 2.9.1 which works perfectly fine.

I've also tried:

System Details

# Wails
Version | v2.9.1

# System
┌────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                          |
| Version      | 2009 (Build: 22631)                                     |
| ID           | 23H2                                                    |
| Go Version   | go1.23.0                                                |
| Platform     | windows                                                 |
| Architecture | amd64                                                   |
| CPU          | Intel(R) Core(TM) i7-8086K CPU @ 4.00GHz                |
| GPU          | NVIDIA GeForce GTX 1080 (NVIDIA) - Driver: 32.0.15.6094 |
| Memory       | 32GB                                                    |
└────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 128.0.2739.54 |
| Nodejs     | N/A          | Installed | 20.16.0       |
| npm        | N/A          | Installed | 10.8.2        |
| *upx       | N/A          | Available |               |
| *nsis      | N/A          | Available |               |
└─────────────── * - Optional Dependency ───────────────┘

Additional context

No response

levinit commented 1 week ago

same as #3681, it will be fixed next release

CaptainFallaway commented 1 week ago

Thanks for quick response