matryer / xbar

Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
https://xbarapp.com
MIT License
17.49k stars 643 forks source link

Didn't show icon in tray in wails dev mode. #845

Open icron opened 2 years ago

icron commented 2 years ago

I am trying to run in dev env: wails dev Everything works well, but wen I click install script via browser. the script crashes

TRACE | Call Subsystem | Got registered method: &{Name:main.PluginsService.InstallPlugin Inputs:[0xc0001f8cc0] Outputs:[0xc0001f8cf0 0xc0001f8d20] Comments: Method:<func(metadata.Plugin) (string, error) Value>}
TRACE | Call Subsystem | Shutdown
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x141f650]

goroutine 12 [running]:
main.(*app).RefreshAll(0xc0001e41a0)
    /Users/test//tod/xbar/app/app.go:246 +0x310
main.(*PluginsService).InstallPlugin(_, {{0x0, 0x0, 0x0}, {0xc00039c3e0, 0x1a}, {0x0, 0x0}, {0x0, 0x0}, ...})
    /Users/test//tod/xbar/app/plugins_service.go:179 +0x4b5
reflect.Value.call({0x14cf880?, 0xc000021b60?, 0x19ac108?}, {0x14f7bdf, 0x4}, {0xc00054d050, 0x1, 0x14ec160?})
    /usr/local/go/src/reflect/value.go:556 +0x845
reflect.Value.Call({0x14cf880?, 0xc000021b60?, 0x40?}, {0xc00054d050, 0x1, 0x1})
    /usr/local/go/src/reflect/value.go:339 +0xbf
github.com/wailsapp/wails/v2/internal/binding.(*BoundMethod).Call(0xc0001d5570, {0xc00054b920, 0x1, 0xc00054b8d0?})
    /Users/aleksandrlukianchikkov/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/binding/boundMethod.go:73 +0x16f
github.com/wailsapp/wails/v2/internal/subsystem.(*Call).processCall(0xc00009a9b0, 0xc000595140)
    /Users/aleksandrlukianchikkov/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/call.go:119 +0x25f
github.com/wailsapp/wails/v2/internal/subsystem.(*Call).Start.func1()
    /Users/aleksandrlukianchikkov/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/call.go:82 +0x95
created by github.com/wailsapp/wails/v2/internal/subsystem.(*Call).Start
    /Users/aleksandrlukianchikkov/go/pkg/mod/github.com/wailsapp/wails/v2@v2.0.0-alpha.72/internal/subsystem/call.go:74 +0x6a
Exiting process (PID: 53918)

It's because by some reasons wails dev doesn't run UI.

How to run in dev mode with UI and tray?

MacOS Big Sur. Intel i9