{"record":{"id":"76155ce5f2f0bc11","repo":"glanceapp/glance","slug":"unknown-widget-type-s","errorCode":null,"errorMessage":"unknown widget type: %s","messagePattern":"unknown widget type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/widget.go","lineNumber":85,"sourceCode":"\t\tw = &searchWidget{}\n\tcase \"extension\":\n\t\tw = &extensionWidget{}\n\tcase \"group\":\n\t\tw = &groupWidget{}\n\tcase \"dns-stats\":\n\t\tw = &dnsStatsWidget{}\n\tcase \"split-column\":\n\t\tw = &splitColumnWidget{}\n\tcase \"custom-api\":\n\t\tw = &customAPIWidget{}\n\tcase \"docker-containers\":\n\t\tw = &dockerContainersWidget{}\n\tcase \"server-stats\":\n\t\tw = &serverStatsWidget{}\n\tcase \"to-do\":\n\t\tw = &todoWidget{}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown widget type: %s\", widgetType)\n\t}\n\n\tw.setID(widgetIDCounter.Add(1))\n\n\treturn w, nil\n}\n\ntype widgets []widget\n\nfunc (w *widgets) UnmarshalYAML(node *yaml.Node) error {\n\tvar nodes []yaml.Node\n\n\tif err := node.Decode(&nodes); err != nil {\n\t\treturn err\n\t}\n\n\tfor _, node := range nodes {\n\t\tmeta := struct {","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget.go#L67-L103","documentation":"newWidget() fell through its type switch: the string in a widget block's type field matches no supported widget type. The listed value is echoed back so the typo is identifiable directly from the error.","triggerScenarios":"A glance.yml page containing a widget whose type is misspelled ('wether'), uses a legacy name removed in a version upgrade, or references a widget compiled out of the build.","commonSituations":"Typos; upgrading Glance and a widget was renamed (config from an older release); community configs referencing custom widget builds.","solutions":["Compare the echoed type against the widget names in the switch statement in internal/glance/widget.go or the docs","Fix the spelling/casing in glance.yml — values are lowercase-hyphenated","If the widget was renamed across versions, update the config to the new name from the changelog"],"exampleFix":"# before\n- type: wether\n\n# after\n- type: weather","handlingStrategy":"validation","validationCode":"// Validate widget types against the known set before starting Glance\nvar knownWidgetTypes = map[string]bool{\n    \"weather\": true, \"videos\": true, \"twitch-channels\": true /* ... full list from widget.go */,\n}\n\nfunc validWidgetType(t string) bool { return knownWidgetTypes[t] }","typeGuard":"func isUnknownWidgetType(err error) bool {\n\treturn err != nil && strings.HasPrefix(err.Error(), \"unknown widget type\")\n}","tryCatchPattern":"w, err := newWidget(cfg.Type)\nif isUnknownWidgetType(err) {\n    // fail config validation with the offending type name; do not silently skip\n    return fmt.Errorf(\"page %q: %w\", pageName, err)\n}","preventionTips":["Lint glance.yml widget types in CI against the docs list for your Glance version","Check the changelog for widget renames when upgrading before reusing old configs"],"tags":["config","yaml","widget","validation"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}