Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"New not declared by package engine (compile)" (app.go:20:25) #45

Open
arnlen opened this issue Apr 25, 2021 · 7 comments
Open

"New not declared by package engine (compile)" (app.go:20:25) #45

arnlen opened this issue Apr 25, 2021 · 7 comments

Comments

@arnlen
Copy link

arnlen commented Apr 25, 2021

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

  1. 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`.
  1. In to guark.yaml, change engineName to webview
# App engine name. Values: webview, chrome, hybrid
engineName: webview
  1. guark run
  2. See error

Expected behavior
Should run the app. 😄

Maybe a configuration related issue?

@melbahja
Copy link
Member

Hello
is your project directory code inside $GOPATH/src?
If yes can you show me your go env output

@arnlen
Copy link
Author

arnlen commented Apr 25, 2021

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"

@melbahja
Copy link
Member

Can you try to run: go run -tags "dev webview" app.go
and tell me if you still having the error?

thanks

@arnlen
Copy link
Author

arnlen commented Apr 25, 2021

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

@melbahja
Copy link
Member

melbahja commented Apr 25, 2021

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

@pierrejoye
Copy link
Contributor

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 :)

@melbahja
Copy link
Member

melbahja commented Jun 1, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants