Wails serves but won't run with built (win10 amd64)
Description I am unable to get wails to work correctly in my win10 env. Testing with vanilla template without any changes after starting project with 'Wails init'. Following along the 'Installing Wails' I am able to get the clean project to serve / display in localhost, but the 'Wails build' .exe will not run and throws script error. 'Script Error', 'Object doesn't support property or method 'addEventListner', Line: 10, Char: 5.
To Reproduce Steps to reproduce the behaviour:
- 'Wails Init' on clean dir and cd into project
- 'Wails build -d' in project root
- On success, navigate to build dir
- Click on 'outputfilename.exe'
- See 'Script Error' on screen.
Expected behaviour I expect application to launch w/o error similar to behavior when serving project in localhost / chrome.
Screenshots

System Details
| Name | Value |
|---|---|
| Wails Version | v1.8.0 |
| Go Version | go1.15.2 |
| Platform | windows |
| Arch | amd64 |
| GO111MODULE | (Not Set) |
| GCC | 9.2.0 |
| Npm | 6.14.8 |
| Node | v12.18.3 |
Additional context Add any other context about the problem here.
The last outputs of the debug console:
time="2020-10-07T15:38:21-05:00" level=debug msg="[WebView] Enabling Wails console"
time="2020-10-07T15:38:21-05:00" level=debug msg="[WebView] Eval" js="(function () {\n\n window.wailsconsole = {};..."
time="2020-10-07T15:38:21-05:00" level=debug msg="[WebView] Eval" js="!function(n){var t={};function e(r){if(t[r])r..."
Thanks for reporting this. Will check today.
In the webview.go file:
w.eventManager.On("wails:loaded", callback) does not appear to fire before error is thrown, w.window.Run() is reached once.
Can't reproduce. Installed v1.8.0, created a vanilla app and it worked fine.

Can't reproduce. Installed v1.8.0, created a vanilla app and it worked fine.
Hmm, what's your environment like? What TDM are you using? Is docker needed for build our just for packaging?
@leaanthony I cleared out wails from my %gopath%\pkg\mod\github.com\wailsapp and re-downloaded it via 'go get'. I'm showing @v1.8.0. I'm still seeing this issue. I'm running go1.15.2, but I did go ahead and set my "GO111MODULE" env var to "on" per instructions. Issue persists per original description.
Commenting out the /assets/console.js import in the webview.go file changes the error to Expected Identifier. This matches the error that I receive when I do NOT run build with debug flag. It seems likely that document.addEventListener('keyup', logKey); in the asset/console.js is the line that throws the error. This suggests that document is not resolving correctly.
The imported code from wails.js when passed through evalJS() causes error during the w.window.eval(js) execution, returning "evaluation failed".
I used Wails v1.8.0, TDM with gcc 9 & Win 10 Pro 2004. Is your machine old/slow? I'm wondering if it's a timing issues with old PCs. Not seen it myself...
I used Wails v1.8.0, TDM with gcc 9 & Win 10 Pro 2004. Is your machine old/slow? I'm wondering if it's a timing issues with old PCs. Not seen it myself...
I wouldn't consider it to be slow (i7-7820HQ Quad @ 2.9GHz , 16GB RAM).
I'm trying to modify your assets/console.js file but my changes aren't reflected when I build. Is it cached somewhere, or am I mistaken in thinking modifying it in %GOPATH%\pkg\mod\github.com\wailsapp\[email protected]\runtime\assets\console.js will change the file being used by your lib?
run scripts/build.sh or go run build.go in the scripts directory.
+1
Issue description
After creating a fresh project with wails init I tried adding Zendesk's Garden UI kit and inserting a component from that library to the app.
When I run wails serve alongside npm run start the app renders correctly and everything is fine.
Building the app with wails build -d return the following error box https://gyazo.com/316824143d1964c2aa44a4d3817bc058
App.js
import React from "react";
import { Anchor } from "@zendeskgarden/react-buttons";
import "./App.css";
const App = () => (
<div className="App">
<Anchor href="#default">Hey</Anchor>
</div>
);
export default App;
edit:
Running npm run build on frontend (after removing the lines relative to wails) gives a fully functional production app, and the components are rendered as expected
Arrow functions will break IE11 unless you use a polyfill.
@Tekk-Know had issues with the vanilla template yesterday. Investigating.
Arrow functions will break IE11 unless you use a polyfill.
Tried again with both class and function Component definition. Issue persists
The only advice I can offer you is include the UIKit code bit by bit from the vanilla template (which works for me now). See what breaks.
part of me is thinking we should inject corejs on windows by default but this may have unintended consequences.
The only advice I can offer you is include the UIKit code bit by bit from the vanilla template (which works for me now). See what breaks.
I tried going this path, adding imports doesn't break the build, but as soon as I include a ui component into the app, whichever it may be, the build breaks, even the simplest components that are just wrappers around HTML elements such as ´H1´ which is a wrapper around the regular ´h1´
Well IE11 can certainly render h5 so there must be something else going on. If you put your examples in a repo, I'll have a look.
Well IE11 can certainly render h5 so there must be something else going on. If you put your examples in a repo, I'll have a look.
I've created a simple wails project that recreates the issue encountered, README is provided for details about the issue https://github.com/Rezrazi/wailsgarden