{"record":{"id":"9f74d8da0dbbceb4","repo":"wailsapp/wails","slug":"implement-me-9f74d8","errorCode":null,"errorMessage":"implement me","messagePattern":"implement me","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/pkg/application/menuitem_linux_gtk3.go","lineNumber":152,"sourceCode":"func newSpeechMenu() *MenuItem {\n\tspeechMenu := NewMenu()\n\tspeechMenu.Add(\"Start Speaking\").\n\t\tSetAccelerator(\"CmdOrCtrl+OptionOrAlt+Shift+.\").\n\t\tOnClick(func(ctx *Context) {\n\t\t\t//\t\t\tC.startSpeaking()\n\t\t})\n\tspeechMenu.Add(\"Stop Speaking\").\n\t\tSetAccelerator(\"CmdOrCtrl+OptionOrAlt+Shift+,\").\n\t\tOnClick(func(ctx *Context) {\n\t\t\t//\t\t\tC.stopSpeaking()\n\t\t})\n\tsubMenu := NewSubMenuItem(\"Speech\")\n\tsubMenu.submenu = speechMenu\n\treturn subMenu\n}\n\nfunc newFrontMenuItem() *MenuItem {\n\tpanic(\"implement me\")\n}\n\nfunc newHideMenuItem() *MenuItem {\n\treturn NewMenuItem(\"Hide \" + globalApplication.options.Name).\n\t\tSetAccelerator(\"CmdOrCtrl+h\").\n\t\tOnClick(func(ctx *Context) {\n\n\t\t\t//\t\t\tC.hideApplication()\n\t\t})\n}\n\nfunc newHideOthersMenuItem() *MenuItem {\n\treturn NewMenuItem(\"Hide Others\").\n\t\tSetAccelerator(\"CmdOrCtrl+OptionOrAlt+h\").\n\t\tOnClick(func(ctx *Context) {\n\t\t\t//\t\t\tC.hideOthers()\n\t\t})\n}","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/wailsapp/wails/blob/0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3/v3/pkg/application/menuitem_linux_gtk3.go#L134-L170","documentation":"newFrontMenuItem is an unimplemented constructor stub in Wails v3's legacy Linux GTK3 menu backend (menuitem_linux_gtk3.go). Building any menu that includes the 'Front' role on Linux makes NewRole (menuitem.go:144-145) call NewFrontMenuItem(), which immediately panics with 'implement me'. The panic happens at menu-construction time (app startup), so the process crashes before a window appears.","triggerScenarios":"Calling App.Menu.AddRole(application.Front) (or NewFrontMenuItem()) on Linux, including in a GTK3-legacy build compiled with -tags gtk3. The panic fires during NewRole's switch dispatch, before the menu is ever rendered.","commonSituations":"Porting a macOS menu (where Front belongs in the Window menu) to Linux; copying cross-platform sample code that adds role-based items unconditionally; upgrading to v3 and reusing v2-era role menus.","solutions":["Remove the AddRole(application.Front) call on Linux and add a plain item instead: Add(NewMenuItem(\"Bring All to Front\").OnClick(...))","Guard role usage behind runtime.GOOS == \"darwin\" so the role is only added where it is implemented","If the role is required, implement newFrontMenuItem yourself in menuitem_linux.go/menuitem_linux_gtk3.go following the pattern of neighboring implemented items (e.g. newHideMenuItem), and file an upstream issue at wailsapp/wails"],"exampleFix":"// before\nmyMenu.AddRole(application.Front)\n\n// after\nif runtime.GOOS == \"darwin\" {\n\tmyMenu.AddRole(application.Front)\n}","handlingStrategy":"validation","validationCode":"// Only add role-based items where the Linux backend implements them\nvar linuxSupportedRoles = map[application.Role]bool{\n\tapplication.Cut: true, application.Copy: true, application.Paste: true,\n\tapplication.SelectAll: true, application.Quit: true, application.FullScreen: true,\n\t// Front, Hide, HideOthers etc. depend on version: verify per release\n}\nfunc safeAddRole(m *application.Menu, r application.Role) {\n\tif runtime.GOOS == \"linux\" && !linuxSupportedRoles[r] {\n\t\treturn\n\t}\n\tm.AddRole(r)\n}","typeGuard":null,"tryCatchPattern":"defer func() {\n\tif r := recover(); r != nil {\n\t\tlog.Printf(\"menu construction failed (unsupported role?): %v\", r)\n\t}\n}()\napp.Menu.AddRole(application.Front)","preventionTips":["Run the app once on every target OS in CI before shipping menus","Prefer explicit NewMenuItem + OnClick over roles for anything not core (edit ops, window ops)","Check menuitem_linux.go for panic stubs before adopting a new Role"],"tags":["linux","gtk","menu","role","panic","not-implemented"],"backgroundTag":null,"analyzedSha":"0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3","analyzedAt":"2026-08-15T14:17:36.034Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}