wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
24.48k stars 1.18k forks source link

wails build with error: \runtime\assets\bridge.js: The system cannot find the path specified #357

Closed drharryhe closed 4 years ago

drharryhe commented 4 years ago

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.

image

this is my project code structure: image the topper in red block is my wails app.

my main.go is as below: image

System Details

Name Value
Wails Version v1.0.2
Go Version go1.13.8
Platform windows
Arch amd64
GO111MODULE (Not Set)
GCC 5.1.0
Npm 6.13.4
Node v12.16.1

Additional context Add any other context about the problem here.

drharryhe commented 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

drharryhe commented 4 years ago

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 } `

leaanthony commented 4 years ago

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?

drharryhe commented 4 years ago

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.

leaanthony commented 4 years ago

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 .

drharryhe commented 4 years ago

the issue happens again. I found the bridges.js is not present in the project folder nor in the vendor folder. image

leaanthony commented 4 years ago

I will look at this today

leaanthony commented 4 years ago

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 👍