wails
wails copied to clipboard
`wails3 generate bindings -ts ` go an error when multi struct on another package (not main)
Description
go version: 1.21.7 wails3 version: v3.0.0-alpha.4
I created a project using the command wails3 init -n wails3-firstapp -t vue-ts 。
then use wails3 generate bindings -ts got an error.
To Reproduce
create file:oth/other.go.
package oth
type OtherService struct {
}
type Person struct {
Name string `json:"name"`
}
func (g *OtherService) Other(name string) *Person {
return &Person{Name: "Hello " + name + "!"}
}
then use wails3 generate bindings -ts.
wails3 generate bindings -ts
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x6f84b2]
goroutine 1 [running, locked to thread]:
github.com/wailsapp/wails/v3/internal/parser.(*Project).RelativeBindingsDir(0xc0002234a0, 0x0, 0x0)
D:/projects/GolandProjects/wails-projects/wails/v3/internal/parser/parser.go:1168 +0x32
C:/Users/zhipe/go/pkg/mod/github.com/leaanthony/[email protected]/command.go:143 +0x18c
reflect.Value.Call({0xabe8a0?, 0xd3c7b0?, 0x0?}, {0xc0000d1d48?, 0xc00007c0f0?, 0x0?})
D:/InstallApps/go/src/reflect/value.go:380 +0xb9
github.com/leaanthony/clir.(*Command).NewSubCommandFunction.func1()
C:/Users/zhipe/go/pkg/mod/github.com/leaanthony/[email protected]/command.go:459 +0x5a
github.com/leaanthony/clir.(*Command).run(0xc000220d20?, {0xc00007c0f0?, 0x1?, 0x1?})
C:/Users/zhipe/go/pkg/mod/github.com/leaanthony/[email protected]/command.go:143 +0x18c
github.com/leaanthony/clir.(*Command).run(0xc000220aa0, {0xc00007c0e0?, 0x2, 0x2})
C:/Users/zhipe/go/pkg/mod/github.com/leaanthony/[email protected]/command.go:122 +0x1cc
github.com/leaanthony/clir.(*Command).run(0xc000220640, {0xc00007c0d0?, 0x3, 0x3})
C:/Users/zhipe/go/pkg/mod/github.com/leaanthony/[email protected]/command.go:122 +0x1cc
github.com/leaanthony/clir.(*Cli).Run(0xc000220a00?, {0x0?, 0x7?, 0xbcb7a7?})
C:/Users/zhipe/go/pkg/mod/github.com/leaanthony/[email protected]/cli.go:73 +0x9b
main.main()
D:/projects/GolandProjects/wails-projects/wails/v3/cmd/wails3/main.go:62 +0x52d
Expected behaviour
generate bindings and models
Screenshots
Attempted Fixes
No response
System Details
$ wails3 doctor
Wails Doctor
# Build Environment
Wails CLI | v3.0.0-alpha.3
Go Version | go1.21.7
Revision | 1956f95f9f9368e0606201dd5e7347779d704067
Modified | true
-buildmode | exe
-compiler | gc
CGO_CFLAGS |
CGO_CPPFLAGS |
CGO_CXXFLAGS |
CGO_ENABLED | 1
CGO_LDFLAGS |
GOAMD64 | v1
GOARCH | amd64
GOOS | windows
vcs | git
vcs.modified | true
vcs.revision | 1956f95f9f9368e0606201dd5e7347779d704067
vcs.time | 2024-02-16T07:04:16Z
# System
Name | Windows 10 Pro
Version | 2009 (Build: 22631)
ID | 23H2
Branding | Windows 11 专业版
Platform | windows
Architecture | amd64
Go WebView2Loader | true
NSIS | Not Installed
WebView2 Version | 121.0.2277.112
CPU | Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
GPU 1 | OrayIddDriver Device (Shanghai Best Oray Information Technology Co., Ltd.) - Driver: 17.1.58.818
GPU 2 | NVIDIA GeForce GTX 1660 Ti (NVIDIA) - Driver: 31.0.15.5152
Memory | 48GB
# Diagnosis
SUCCESS Your system is ready for Wails development!
Additional context
No response
Thanks for reporting. Please follow the guidelines here: https://v3alpha.wails.io/getting-started/feedback/#__tabbed_1_1