"New not declared by package engine (compile)" (app.go:20:25)
arnlen opened this issue · comments
Device:
- OS: MacOS
- Version: Big Sur 11.2.3
- Go Version: 1.16.3
Describe the bug
On a freshly generated app, when configured with "webview", the command guark run
raises the error:
[...]/app.go:20:25 New not declared by package engine (compile)
To Reproduce
guark init --template vue -mod github.com/arnlen/guark_training
✔ Remote template validated
✔ Template downloaded successfully.
✔ App module name refactored
⏺ Setup commands:
- "yarn install" (dir: ui)
- "go mod download"
- "go mod tidy"
- "go mod verify"
✔ Running setup command: yarn install
warning " > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
✔ Running setup command: go mod download
✔ Running setup command: go mod tidy
✔ Running setup command: go mod verify
✔ Done! cd to /[...]/guark_training and run `guark run`.
- In to guark.yaml, change
engineName
towebview
# App engine name. Values: webview, chrome, hybrid
engineName: webview
guark run
- See error
Expected behavior
Should run the app. 😄
Maybe a configuration related issue?
Hello
is your project directory code inside $GOPATH/src
?
If yes can you show me your go env
output
Thanks for your quick replay @melbahja. 🙏
No, my project's directory isn't inside $GOPATH/src
.
# Project path
/Users/arnlen/dev/go_projects/guark_training
# echo $GOPATH
/Users/arnlen/go
And here is my go env
output:
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/arnlen/Library/Caches/go-build"
GOENV="/Users/arnlen/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/arnlen/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/arnlen/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.16.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.16.3/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/arnlen/dev/go_projects/guark_training/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/v1/x95rv0r17xq46d1z0m0g98gh0000gn/T/go-build2348559153=/tmp/go-build -gno-record-gcc-switches -fno-common"
Can you try to run: go run -tags "dev webview" app.go
and tell me if you still having the error?
thanks
$ go run -tags "dev webview" app.go
DEBU[0000] Init: dialog plugin. lebel=app
DEBU[0000] Init: notify plugin. lebel=app
DEBU[0000] Init: clipboard plugin. lebel=app
And then... nothing.
I can only see the label "app" on the OSX topbar + the app in the Dock, showing that the app had been somehow launched, but no window on the screen.
OK can you change hint
value in guark.yaml to none
. if it works with go run -tags "dev webview" app.go
then try guark run
Interestingly it was working fine the 1st time I use it (once I did the config change for cc&co, then without any code change, I get the same error.
I think something is wrong in how the Engine is initialized or imported. The New method also seems not to be always associated with a selected engine.
I would rather recommend to do it using Interface, which gets overridden in each specific engine if needed. Or maybe this is what it is done but it is failing here too. I hope I can take a deeper look at a later point :)
I would rather recommend to do it using Interface, which gets overridden in each specific engine if needed. Or maybe this is what it is done but it is failing here too. I hope I can take a deeper look at a later point :)
I hope, the problem is I don't have a MacOS device to test it on, so when I developed guark I just did what I can to make it work on macOS