wails icon indicating copy to clipboard operation
wails copied to clipboard

After Build Cannot Run in Win10 AMD64

Open divowu opened this issue 3 years ago • 14 comments

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

divowu avatar Sep 09 '22 03:09 divowu

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

glitchedgitz avatar Sep 09 '22 06:09 glitchedgitz

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 🙏

stffabi avatar Sep 09 '22 07:09 stffabi

Thanks for your quick reply!

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

  • Installing frontend dependencies: Done.
  • Compiling frontend: Done.
  • Generating bundle assets: Done.
  • Compiling application: Error: open D:\workspace\go\wails\helloworld\frontend\wailsjs\runtime\package.json: Access is denied.

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 avatar Sep 09 '22 08:09 divowu

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 avatar Sep 09 '22 08:09 divowu

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

divowu avatar Sep 09 '22 09:09 divowu

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.

107295472 avatar Sep 13 '22 00:09 107295472

@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

leaanthony avatar Sep 13 '22 01:09 leaanthony

@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

divowu avatar Sep 13 '22 08:09 divowu

How can I test windows 10 ARM?

leaanthony avatar Sep 13 '22 08:09 leaanthony

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

leaanthony avatar Sep 13 '22 08:09 leaanthony

@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.

stffabi avatar Sep 13 '22 08:09 stffabi

@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

divowu avatar Sep 13 '22 09:09 divowu

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

stffabi avatar Sep 13 '22 09:09 stffabi

FY. image

divowu avatar Sep 13 '22 09:09 divowu

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.

leaanthony avatar Sep 14 '22 23:09 leaanthony

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

107295472 avatar Sep 15 '22 02:09 107295472

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.

stale[bot] avatar Nov 02 '22 02:11 stale[bot]

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 avatar Apr 14 '23 14:04 HeCorr

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.

HeCorr avatar Apr 14 '23 15:04 HeCorr

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

misitebao avatar Apr 14 '23 16:04 misitebao

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

leaanthony avatar Apr 14 '23 20:04 leaanthony

@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 avatar Apr 14 '23 23:04 HeCorr

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.

HeCorr avatar Apr 14 '23 23:04 HeCorr

That would be great, thanks!

leaanthony avatar Apr 15 '23 08:04 leaanthony