wailsapp / wails

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

[V2 Windows] Blank screen and keyboard shortcut crashes #756

Closed nickarellano closed 3 years ago

nickarellano commented 3 years ago

Description

I have been experimenting and learning Wails V2 and having a blast! I did notice though that on the Windows build I'm seeing a behavior where Ctrl + R crashes the program and also some builds the application is just white as pictured below.

My application is using Vite bundling assets in library mode using Vue3 and Vue Router. I currently have no keybind code in the Wails app and have only been working on the frontend Vue side of the app so far and testing how things look.

My primary OS is macOS and there are 0 problems for me on macOS, I'm just seeing these issues as I try building on Windows to see what the experience is like.

To Reproduce Steps to reproduce the behaviour:

  1. Run wails.exe build -package -production for my project
  2. Open the program and sometimes when I build it's blank as in the screenshot
  3. Press Ctrl + R to crash the program

I also notice that on a fresh new build of the program if it loads fine, I can press Ctrl + R which crashes the program. Then when I reopen the program it's blank again.

Screenshots Crashed visual of the program

Screen Shot 2021-07-12 at 4 45 31 PM

What the program should look like

Screen Shot 2021-07-12 at 4 46 18 PM

System Details

System
------
OS:             Windows 10 Pro
Version:        2009 (Build: 19043)
ID:             21H1
Go Version:     go1.16.5
Platform:       windows
Architecture:   amd64

Dependency      Package Name    Status          Version
----------      ------------    ------          -------
gcc             N/A             Installed       gcc (tdm64-1) 10.3.0
npm             N/A             Installed       6.14.13
*upx            N/A             Available
*docker         N/A             Available

* - Optional Dependency

Diagnosis
---------
Your system is ready for Wails development!
Optional package(s) installation details:
  - upx : Available at https://upx.github.io/
  - docker : Available at https://www.docker.com/products/docker-desktop
leaanthony commented 3 years ago

Thanks for the info @nickarellano. It looks like the WebView2 control binds a bunch of keyboard shortcuts by default and it looks like ctrl-r is "reload". sometimes this leads to a crash for me, other times I get the expected white window. It looks like MS recently added support for installing your own event handler for keys so I'll look at that. I'm at a loss why this should persist for you as I can't reproduce that at all!

nickarellano commented 3 years ago

Hmm yeah that is really odd why it would persist unless it has something to do with Vite in library mode and it not loading for some reason.

Is the pinned cross compilation thread applicable to V2 as well?

misitebao commented 3 years ago

@nickarellano The reason why there is a problem only in windows, maybe because vite and vue3 do not support IE11.🤪You can check the support status through caniuse:

nickarellano commented 3 years ago

@misitebao If that was the case, the application just wouldn't render all the time. There is something different on my Windows VM environment that is causing it more frequently. I sent the binary to a few other people who have Windows computers and the programs loads just fine. The only standing issue is the refresh hotkey crashing the application.

leaanthony commented 3 years ago

This is v2 so no IE. Pinned thread, yes (I've not looked at it in context of v2 yet). Perhaps there's an older version of webview2 runtime in the VM. This is a great test and would ask if you can keep a.snapshot of that 😃 I hadn't thought about his scenario.

nickarellano commented 3 years ago

I will definitely keep a snapshot :) I think the runtime on that VM was downloaded via the Wails 2 prompt, not off of the website mode. I only need the VM to build the Windows binary. I'm testing in on another laptop and desktop system since the one in the VM is a little funky.

nickarellano commented 3 years ago

I also noticed that hovering over links in the Windows build shows a bunch of HTML at the bottom of the screen.

leaanthony commented 3 years ago

Thanks for all the testing! Feel free to keep opening tickets as this is the stuff I want to prioritise right now.

leaanthony commented 3 years ago

Hey Nick, I was thinking that perhaps the VM funkiness is the opposite of what I presumed: perhaps the latest version of the runtime has some breaking change. I've added some debug code so that we can test this:

> .\build\bin\menus.exe -loglevel debug DEBUG | WebView2 Runtime installed: Name: 'Microsoft Edge WebView2 Runtime' Version:'91.0.864.67' Location:'C:\Program Files (x86)\Microsoft\EdgeWebView\Application'. Minimum version required: 91.0.864.48.

Cheers.

EDIT: Oh, it could just be a vmware graphics driver compatibility issue with WebView2

leaanthony commented 3 years ago

@nickarellano have done a release (v2.0.0-alpha.73) with a potential fix for the default hotkeys. I say potential because I'm unsure at this time if it'll affect menus. Let me know how you go!

nickarellano commented 3 years ago

After having a bunch of people test and working on different machines, the VMWare display driver does make a lot of sense on what could be happening.

@leaanthony To confirm, the alpha 73 does unbind they keyboard shortcut :)

leaanthony commented 3 years ago

Thanks for the update @nickarellano . Amazing work on the testing and thanks for raising this!