wailsapp / wails

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

After Build Cannot Run in Win10 AMD64 #1837

Open divowu opened 2 years ago

divowu commented 2 years ago

Description

I create a HelloWorld project and build it. But the builded application cannot runing in my windows 10 amd64.(Nothing window ui being open) It can runing well in win 11.

To Reproduce

1, create a helloworld project and build it , with below wails commands: wails init -n helloworld wails build 2, Double click the compiled exe file : ${project folder}/build/bin/helloworld.exe

After clicked , nothing happen in my win10 amd64, but it work in win11 amd64.

Expected behaviour

Nothing.

Screenshots

No response

Attempted Fixes

No response

System Details

Wails CLI v2.0.0-beta.44.2

System
------
OS:             Windows 10 Pro
Version:        1903 (Build: 18362)
ID:
Go Version:     go1.19.1
Platform:       windows
Architecture:   amd64

Wails
------
Version:        v2.0.0-beta.44.2

Dependency      Package Name    Status          Version
----------      ------------    ------          -------
WebView2        N/A             Installed       105.0.1343.27
npm             N/A             Installed       8.19.1
*upx            N/A             Installed       upx 3.96
*nsis           N/A             Installed       v3.08

* - Optional Dependency

Diagnosis
---------
Your system is ready for Wails development!

If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Additional context

No response

glitchedgitz commented 2 years ago

Working with these specs for me. Try to run with wails dev and check the error.

Wails CLI v2.0.0-beta.44.2

Scanning system - Please wait (this may take a long time)...Done.

System
------
OS:             Windows 10 Home
Version:        2009 (Build: 19044)
ID:             21H2
Go Version:     go1.18.5
Platform:       windows
Architecture:   amd64

Wails
------
Version:        v2.0.0-beta.44.2

Dependency      Package Name    Status          Version
----------      ------------    ------          -------
WebView2        N/A             Installed       105.0.1343.27
npm             N/A             Installed       8.11.0
*upx            N/A             Available
*nsis           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/
  - nsis : Available at https://nsis.sourceforge.io/Download
stffabi commented 2 years ago

Thanks for using Wails und reporting this.

Could you please build a debug build wails build --debug and paste the output of the console when started from the command line on your Win10 system?

Thanks 🙏

divowu commented 2 years ago

Thanks for your quick reply!

When I use this command, it has the following error: Building target: windows/amd64

ERROR: open D:\workspace\go\wails\helloworld\frontend\wailsjs\runtime\package.json: Access is denied.

And I found out the folder ‘frontend/wailsjs/runtime’ has been deleted.

divowu commented 2 years ago

The above error occurred when I used this command ‘wails build -debug’.

When I use 'wails dev‘, And then I got blow message:

vite v2.9.15 building for production... transforming... ✓ 4 modules transformed.

Could not resolve '../wailsjs/go/main/App' from src/main.js
error during build:
Error: Could not resolve '../wailsjs/go/main/App' from src/main.js
    at error (D:\workspace\go\wails\helloworld\frontend\node_modules\rollup\dist\shared\rollup.js:198:30)
    at ModuleLoader.handleResolveId (D:\workspace\go\wails\helloworld\frontend\node_modules\rollup\dist\shared\rollup.js:22464:24)
    at D:\workspace\go\wails\helloworld\frontend\node_modules\rollup\dist\shared\rollup.js:22427:26

ERROR: exit status 1

divowu commented 2 years ago

Sorry for my mistaken. The command I used ‘wails build --debug' instead of ‘wails build -debug', It can build a debug mode application. But I run the application, It hold on a black screen.

mistaken

107295472 commented 2 years ago

me too And I found out the folder ‘frontend/wailsjs/runtime’ has been deleted. And I found out the folder ‘frontend/wailsjs/go/main’ has been deleted.

leaanthony commented 2 years ago

@divowu @107295472 - Could you please try the latest release as this includes a change that should fix this issue? To upgrade, please run: wails update -pre

divowu commented 2 years ago

@leaanthony , I update wails with your command wails update -pre and update the wails module to v2.0.0-rc.1.1, build a debug mod application with wails build --debug. It still hold on a black screen. mistaken

leaanthony commented 2 years ago

How can I test windows 10 ARM?

leaanthony commented 2 years ago

One thing to do: build with wails build -debug and then right click the blank window and check the console logs via inspect->console

stffabi commented 2 years ago

@divowu It seems like you are selecting one character from the console window, indicated by the "white rectangle" in your last screenshot. If you select in the console window, the whole app is getting blocked, this is a common behaviour on windows due to blocked message loop. Please deselect by clicking again into the console window and pressing enter.

divowu commented 2 years ago

@stffabi

indicated by the "white rectangle" in your last screenshot ...

No, The rectangle is where I selected in the console window text select box.

@leaanthony , Nothing happen when I right click the blank window. mistaken

stffabi commented 2 years ago

Have you tried use wails dev? What's the output there?

divowu commented 2 years ago

FY. image

leaanthony commented 2 years ago

I'm not really sure this relates to the architecture of your OS. If you create a new project, using the release candidate, are you able to reproduce this error? This looks like bad imports to me.

107295472 commented 2 years ago

Can't use dev, build, or tasks in vscode dev cannot generate files for wailsjs/go/main/xxx

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

HeCorr commented 1 year ago

I'm also having issues on Windows.. on the rare occasions where the build succeeds (similar behavior as #2367), running the output .exe does literally nothing, not even launching it via CMD. That being said, wails dev launches just fine (when it decides to).

What makes this really frustrating to me is that I've been trying to create this program for a friend of mine for about a week, first with Fyne and then Gio but I was unable to get anywhere with either of them, so I tried with Wails and did succeed, but I am unable to build the program for my friend to use.

I'm on Windows 10 and already tried Wails versions 2.4.1, 2.4.0 and 2.3.1 (wails update -pre did nothing) to no avail.

As far as I can tell, the WebView2 runtime is installed on my system (it said so when trying to install it manually).

HeCorr commented 1 year ago

Update: I just learned that by not including the -windowsconsole flag during builds, it doesn't show any errors if you launch the .exe via CMD/Powershell (which I guess kinda makes sense), so it turned out that I had changed the code in a way that prevented it from properly functioning and it was producing an error, I just couldn't see it due to the lack of the flag.

I have now fixed the code and it now works as expected. It still doesn't explain why dev builds worked, but I digress.

Please disregard my previous comment.

misitebao commented 1 year ago

Please switch to the latest version and try again, if the error persists, please provide the reproduction code.

leaanthony commented 1 year ago

@HeCorr could you possibly explain what the core issue was and if we need to fix something? Thanks

HeCorr commented 1 year ago

@leaanthony I had removed a piece of code that I thought wasn't essential (because dev builds kept working without it) but turned out to be, so as far as I can tell, build doesn't need fixing, but dev definitely does: #2367

HeCorr commented 1 year ago

Actually, that issue seems to be a bit different than mine. My wailsjs/runtime and wailsjs/go folders do get deleted/recreated when starting up a dev instance and that often causes (what I believe to be) tsc errors saying that the module wasn't found.

If you want I can create a separate issue that addresses it with more details.

leaanthony commented 1 year ago

That would be great, thanks!