Closed drharryhe closed 4 years ago
it looks like use wrong context dir when compile topper\vendor\github.com\wailsapp\wails\cmd\helpers.go. it not use the dir of helpers.go ,but the dir of main.go
this is my main.go `package main
import ( "github.com/leaanthony/mewn" "github.com/wailsapp/wails"
"ktop/topper/model"
)
func main() { js := mewn.String("./frontend/dist/app.js") css := mewn.String("./frontend/dist/app.css")
app := wails.CreateApp(&wails.AppConfig{
Width: 1024,
Height: 768,
Title: "Demo",
JS: js,
CSS: css,
Colour: "#990000",
Resizable: true,
})
//conf := model.NewConfig()
//if conf == nil {
// return
//}
app.Bind(model.NewDemoEngine(nil))
app.Run()
} `
this is my demo module: ` package model
import "github.com/wailsapp/wails"
type ModMethodResult struct {
Error string json:"error"
Data interface{} json:"data"
}
func NewDemoEngine(conf Config) DemoEngine { engine := new(DemoEngine) //engine.Prepare(conf) return engine }
type DemoEngine struct { //BaseModule }
func (this DemoEngine) WailsInit(runtime wails.Runtime) error { //if err := this.BaseModule.WailsInit(runtime); err != nil { // return err //}
return nil
}
func (this *DemoEngine) WailsShutdown() {
}
func (this DemoEngine) Echo(ps map[string]interface{}) ModMethodResult { res := new(ModMethodResult) res.Data = ps return res } `
Ah so this is specifically when using Wails in the context of a vendor directory? The project is designed to be use as a Go Module and hasn't been designed for use like this. Does it work if you don't vendor it?
it's interesting. i just use goland open topper as the project, and wails build succeeds. the gomodule config is the same as the my origianl project. the difference between to projects is that ,the first project contains topper(desktop program) and the backend server and the second one just contains topper.
i dont know why but the project does build successfully.
Thanks for your response anyway, leaanthony.
I'm glad you found a solution!
On Sat, 7 Mar 2020, 12:44 drharryhe, notifications@github.com wrote:
it's interesting. i just use goland open topper as the project, and wails build succeeds. the gomodule config is the same as the my origianl project. the difference between to projects is that ,the first project contains topper(desktop program) and the backend server and the second one just contains topper.
i dont know why but the project does build successfully.
Thanks for your response anyway, leaanthony.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wailsapp/wails/issues/357?email_source=notifications&email_token=AAO2SYDOQHPLL3HRCJFRZTDRGGRHNA5CNFSM4LCJKCL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEODLIFI#issuecomment-596030485, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO2SYBOLC5TM4X65W6HZ43RGGRHNANCNFSM4LCJKCLQ .
the issue happens again. I found the bridges.js is not present in the project folder nor in the vendor folder.
I will look at this today
Ok, I can reproduce this and based on time constraints, all i can say is I won't have time to support vendoring. At least, not for v1. If you delete your vendor folder, it will work. I have added vendoring as a ticket for v2 though 👍
Description
I write a demo, it can run well with wails serve/npm run serve. but when i try to build it to an exe, it fail with the error below:
To Reproduce Steps to reproduce the behaviour: do wails build on win10
Expected behaviour build exe successfully
Screenshots If applicable, add screenshots to help explain your problem.
this is my project code structure: the topper in red block is my wails app.
my main.go is as below:
System Details
Additional context Add any other context about the problem here.