wailsapp/wails · error
Implement me
Error message
Implement me
What it means
newPrintMenuItem is an unimplemented stub in the Linux GTK3 menu backend. The Role 'Print' dispatches through NewRole (menuitem.go:192-193) to NewPrintMenuItem(), which panics with 'Implement me' at menu-build time, crashing the application on startup. Identical stubs exist in the default GTK4 backend (menuitem_linux.go:337), so both Linux flavors are affected.
Source
Thrown at v3/pkg/application/menuitem_linux_gtk3.go:374
currentWindow := globalApplication.Window.Current()
if currentWindow != nil {
currentWindow.Zoom()
}
})
}
func newFullScreenMenuItem() *MenuItem {
return NewMenuItem("Fullscreen").
OnClick(func(ctx *Context) {
currentWindow := globalApplication.Window.Current()
if currentWindow != nil {
currentWindow.Fullscreen()
}
})
}
func newPrintMenuItem() *MenuItem {
panic("Implement me")
}
func newPageLayoutMenuItem() *MenuItem {
panic("Implement me")
}
func newShowAllMenuItem() *MenuItem {
panic("Implement me")
}
func newBringAllToFrontMenuItem() *MenuItem {
panic("Implement me")
}
func newNewFileMenuItem() *MenuItem {
panic("Implement me")
}
View on GitHub (pinned to 0e754b1b40)
Solutions
- Replace AddRole(application.Print) with an explicit item wired to your own print logic: Add(NewMenuItem("Print").SetAccelerator("CmdOrCtrl+p").OnClick(func(ctx *application.Context) { ... }))
- Restrict the Print role to platforms where it is implemented (check runtime.GOOS before AddRole)
- Contribute an implementation of newPrintMenuItem upstream (e.g. invoking the WebKitGTK print dialog via window.Print()) and track it as a GitHub issue
Example fix
// before
fileMenu.AddRole(application.Print)
// after
fileMenu.Add(application.NewMenuItem("Print").
SetAccelerator("CmdOrCtrl+p").
OnClick(func(ctx *application.Context) { app.Window.Current().Print() })) Defensive patterns
Strategy: validation
Validate before calling
var unsupportedOnLinux = map[application.Role]bool{
application.Print: true, application.PageLayout: true,
application.NewFile: true, application.Open: true,
application.Save: true, application.SaveAs: true, application.Revert: true,
application.Find: true, application.FindAndReplace: true,
application.FindNext: true, application.FindPrevious: true,
application.StartSpeaking: true, application.StopSpeaking: true,
application.ShowAll: true, application.BringAllToFront: true,
application.Front: true, application.Help: true,
}
func addRole(m *application.Menu, r application.Role) {
if runtime.GOOS == "linux" && unsupportedOnLinux[r] {
return
}
m.AddRole(r)
} Try / catch
defer func() {
if r := recover(); r != nil {
log.Printf("menu build panic: %v", r)
}
}()
fileMenu.AddRole(application.Print) Prevention
- Treat the Role enum as macOS-complete but Linux-partial; audit every AddRole against menuitem_linux.go
- Wrap menu construction in a recover during development to get a log instead of a crash
- Implement app-specific behaviors (print, find) as explicit items from day one
When it happens
Trigger: Calling AddRole(application.Print) or NewPrintMenuItem() in an application running on Linux (with or without -tags gtk3). The panic occurs during menu construction, before the UI shows.
Common situations: Menus written on Windows/macOS where printing roles are expected; v2-to-v3 migrations that keep role-based File menus; test runs on Linux CI for an app developed on another OS.
Related errors
AI-assisted analysis of wailsapp/wails@0e754b1b40 (2026-08-15).
Data as JSON: /api/errors/238d0d3c8b714766.
Report an issue: GitHub.