wails icon indicating copy to clipboard operation
wails copied to clipboard

[v3] Windows: catastrophic failure on cancel SaveFileDialog

Open eryalito opened this issue 11 months ago • 6 comments

Description

Discussion on Discord: https://discord.com/channels/1042734330029547630/1372320919103475743

When the SaveFileDialog is opened and cancelled or closed the application closes with a catastrophic failure.

To Reproduce

  1. Use the v3-wails branch for wails,
  2. Clone the repo https://github.com/eryalito/wails-savefiledialogs-bug,
  3. wails3 dev,
  4. Press the greet button,
  5. Cancel or close the dialog

Expected behaviour

The application should not fail in that way. It should return and error or an empty string.

Screenshots

******************************** FATAL *********************************
*      There has been a catastrophic failure in your application.      *
**************************** Error Details *****************************
panic error: interface conversion: interface {} is nil, not string
runtime.panicdottypeE
        at C:/Users/eryalito/go/pkg/mod/golang.org/[email protected]/src/runtime/iface.go:275
github.com/wailsapp/wails/v3/pkg/application.(*windowSaveFileDialog).show.func2
        at C:/Users/eryalito/Documents/repos/wails/v3/pkg/application/dialogs_windows.go:201
runtime.goexit
        at C:/Users/eryalito/go/pkg/mod/golang.org/[email protected]/src/runtime/asm_amd64.s:1700
************************************************************************

Attempted Fixes

No response

System Details

# System 

┌────────────────────────────────────────────────────────────────────────────────────────────┐
| Name              | Windows 10 Home                                                        |
| Version           | 2009 (Build: 26100)                                                    |
| ID                | 24H2                                                                   |
| Branding          | Windows 11 Home                                                        |
| Platform          | windows                                                                |
| Architecture      | amd64                                                                  |
| Go WebView2Loader | true                                                                   |
| WebView2 Version  | 136.0.3240.64                                                          |
| CPU               | 11th Gen Intel(R) Core(TM) i9-11900K @ 3.50GHz                         |
| GPU 1             | Intel(R) UHD Graphics 750 (Intel Corporation) - Driver: 32.0.101.6078  |
| GPU 2             | NVIDIA GeForce RTX 3060 Ti (NVIDIA) - Driver: 32.0.15.6624             |
| Memory            | 32GB                                                                   |
└────────────────────────────────────────────────────────────────────────────────────────────┘

# Build Environment 

┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| Wails CLI      | v3.0.0-alpha.9                                                                                                            |
| Go Version     | go1.23.5                                                                                                                  |
| Revision       | c186917c34855a286227456386482fc98ca538fe                                                                                  |
| Modified       | true                                                                                                                      |
| -buildmode     | exe                                                                                                                       |
| -compiler      | gc                                                                                                                        |
| CGO_ENABLED    | 0                                                                                                                         |
| DefaultGODEBUG | asynctimerchan=1,gotypesalias=0,httpservecontentkeepheaders=1,tls3des=1,tlskyber=0,x509keypairleaf=0,x509negativeserial=1 |
| GOAMD64        | v1                                                                                                                        |
| GOARCH         | amd64                                                                                                                     |
| GOOS           | windows                                                                                                                   |
| vcs            | git                                                                                                                       |
| vcs.modified   | true                                                                                                                      |
| vcs.revision   | c186917c34855a286227456386482fc98ca538fe                                                                                  |
| vcs.time       | 2025-01-13T10:30:16Z                                                                                                      |
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies 

┌───────────────────────────┐
| npm  | 10.9.0             |
| NSIS | Not Installed      |
└─ * - Optional Dependency ─┘

# Diagnosis 

 SUCCESS  Your system is ready for Wails development!

Additional context

No response

eryalito avatar May 14 '25 22:05 eryalito

👋 Thanks for reporting this issue! To help us investigate, could you please:

  1. Add the output of wails doctor if not already included
  2. Provide clear steps to reproduce the issue
  3. If possible, create a minimal reproduction of the issue

This will help us resolve your issue much faster. Thank you!

github-actions[bot] avatar May 14 '25 22:05 github-actions[bot]

👋 Thanks for reporting this issue! To help us investigate, could you please:

  1. Add the output of wails doctor if not already included
  2. Provide clear steps to reproduce the issue
  3. If possible, create a minimal reproduction of the issue

This will help us resolve your issue much faster. Thank you!

github-actions[bot] avatar May 14 '25 22:05 github-actions[bot]

It works fine on my Windows 10. But I removed the line replace github.com/wailsapp/wails/v3 => ../wails/v3 from your go.mod file. It looks like you're using your own version of wails/v3.

hkhere avatar May 14 '25 23:05 hkhere

Hi @hkhere. I did this so I could try the latest version on the v3-alpha branch, using the tag v3.0.0-alpha9 works since the change was made afterwards. For reference, ../wails is a clone of the upstream repo (this one) on the last commit on that branch (tested on 3716aca)

eryalito avatar May 15 '25 08:05 eryalito

@eryalito I see the problem and have reviewed your PR, but I think the changes in your PR are not quite appropriate, so I’ve submitted another PR 4284

hkhere avatar May 16 '25 00:05 hkhere

@hkhere Indeed your changes look way better, thanks!

eryalito avatar May 16 '25 14:05 eryalito

Hey! this issue has been fixed (I tried it on alpha.19)

I'm closing the issue now. Thank you @hkhere and @leaanthony

eryalito avatar Aug 05 '25 21:08 eryalito