{"record":{"id":"0dd089d4fb54df24","repo":"glanceapp/glance","slug":"search-bang-d-has-no-url","errorCode":null,"errorMessage":"search bang #%d has no URL","messagePattern":"search bang #(.+?) has no URL","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/widget-search.go","lineNumber":66,"sourceCode":"\t}\n\n\tif widget.Placeholder == \"\" {\n\t\twidget.Placeholder = \"Type here to search…\"\n\t}\n\n\tif url, ok := searchEngines[widget.SearchEngine]; ok {\n\t\twidget.SearchEngine = url\n\t}\n\n\twidget.SearchEngine = convertSearchUrl(widget.SearchEngine)\n\n\tfor i := range widget.Bangs {\n\t\tif widget.Bangs[i].Shortcut == \"\" {\n\t\t\treturn fmt.Errorf(\"search bang #%d has no shortcut\", i+1)\n\t\t}\n\n\t\tif widget.Bangs[i].URL == \"\" {\n\t\t\treturn fmt.Errorf(\"search bang #%d has no URL\", i+1)\n\t\t}\n\n\t\twidget.Bangs[i].URL = convertSearchUrl(widget.Bangs[i].URL)\n\t}\n\n\twidget.cachedHTML = widget.renderTemplate(widget, searchWidgetTemplate)\n\treturn nil\n}\n\nfunc (widget *searchWidget) Render() template.HTML {\n\treturn widget.cachedHTML\n}\n","sourceCodeStart":48,"sourceCodeEnd":79,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-search.go#L48-L79","documentation":"Returned by searchWidget's config validation (internal/glance/widget-search.go:66) when a bangs[] entry has a shortcut but no url key. Same lifecycle as 137: fires at startup, fails the whole search widget, position reported in the message. Note the URL must also survive convertSearchUrl — a URL without a {QUERY} placeholder may be left unusable, though only an empty string triggers this specific error.","triggerScenarios":"A bang with shortcut: g but a misspelled 'link:'/'href:' key instead of url:, or url left empty (url:) — validation rejects the empty string before convertSearchUrl runs.","commonSituations":"Renaming url to a preferred key name; template copy-paste where the URL line was commented out; refactoring config and dropping the url line while keeping shortcut.","solutions":["Add the url key with the search URL containing the {QUERY} placeholder","Use exact key names: shortcut and url","Verify with the error's #N which bang item is missing its url"],"exampleFix":"// before (glance.yml)\nwidget:\n  type: search\n  bangs:\n    - shortcut: d\n      link: https://duckduckgo.com/?q=QUERY\n// after\nwidget:\n  type: search\n  bangs:\n    - shortcut: d\n      url: https://duckduckgo.com/?q=QUERY","handlingStrategy":"validation","validationCode":"for i, b := range bangs {\n    if b.URL == \"\" {\n        return fmt.Errorf(\"bang %d missing url\", i)\n    }\n}","typeGuard":null,"tryCatchPattern":"// Config error surfaced at widget init; correct the url key in glance.yml","preventionTips":["Exact key names: shortcut, url","Include the {QUERY} placeholder in URLs","Remove half-written bang entries"],"tags":["search","config","validation","yaml"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}