{"record":{"id":"fdabcfe9b263bed6","repo":"d12frosted/homebrew-emacs-plus","slug":"invalid-icon-ver-in-path-version-maps-cann","errorCode":null,"errorMessage":"Invalid 'icon.#{ver}' in #{path}\nVersion maps cannot be nested.\nGot: #{spec.inspect}","messagePattern":"Invalid 'icon\\.#(.+?)' in #(.+?)\nVersion maps cannot be nested\\.\nGot: #(.+?)","errorType":"validation","errorClass":"ConfigurationError","httpStatus":null,"severity":"error","filePath":"Library/BuildConfig.rb","lineNumber":218,"sourceCode":"        prev = d[0]\n        d[0] = j\n        (1..m).each do |i|\n          temp = d[i]\n          d[i] = [d[i] + 1, d[i - 1] + 1, prev + (s1[i - 1] == s2[j - 1] ? 0 : 1)].min\n          prev = temp\n        end\n      end\n      d[m]\n    end\n\n    def validate_icon!(icon, path)\n      # An empty hash is neither a usable spec nor a version map; let the\n      # spec validator produce the \"url and sha256 required\" error for it\n      if version_map?(icon) && !icon.empty?\n        validate_version_map_keys!(icon, \"icon\", path)\n        icon.each do |ver, spec|\n          if version_map?(spec)\n            raise ConfigurationError,\n              \"Invalid 'icon.#{ver}' in #{path}\\n\" \\\n              \"Version maps cannot be nested.\\n\" \\\n              \"Got: #{spec.inspect}\"\n          end\n          validate_icon_spec!(spec, path, key: \"icon.#{ver}\")\n        end\n      else\n        validate_icon_spec!(icon, path)\n      end\n    end\n\n    def validate_icon_spec!(icon, path, key: \"icon\")\n      case icon\n      when String, nil\n        # Valid: icon name from registry or no icon\n        return\n      when Hash\n        unless icon[\"url\"] && icon[\"sha256\"]","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/d12frosted/homebrew-emacs-plus/blob/01c47fe98f35ff28a37a89e1f7aafadff621f9e0/Library/BuildConfig.rb#L200-L236","documentation":"`icon` was recognized as a version map (a Hash that is not a {url, sha256} spec), so validate_icon! iterates its version -> spec entries - and found an entry whose value is itself another map (version_map?(spec) true, Library/BuildConfig.rb:217). Version maps are exactly one level deep: each version key must map straight to a String (registry icon name) or a {url, sha256} spec, never to another map. The message names the offending version key ('icon.30' style) and shows the nested value.","triggerScenarios":"A build.yml shaped like `icon:` / `  \"30\":` / `    default:` / `      url: ...` - a 'default' (or a second version) nested inside a version key; any indentation slip that pushes a version key one level under another version key; or merging two example configs so specs end up double-wrapped.","commonSituations":"Users combining a fallback icon with per-version icons and assuming 'default' lives inside each version entry; copy-paste of nested examples from issues or blogs; indentation off by two spaces so a key lands under the wrong parent.","solutions":["Flatten the map: every version key sits directly under `icon:`, and each maps straight to a name or a {url, sha256} spec.","Move `default:` to be a sibling of the version keys (a direct child of `icon:`), not nested inside one.","Check indentation - two spaces per level, with all version keys aligned under `icon:`.","If you only need one icon, drop the version map entirely and use `icon: Spacemacs` or the flat {url, sha256} form."],"exampleFix":"# before - 'default' nested inside the \"30\" entry\nicon:\n  \"30\":\n    default:\n      url: https://example.com/e30.icns\n      sha256: 1111111111111111111111111111111111111111111111111111111111111111\n\n# after - one level: version keys map straight to specs\nicon:\n  default:\n    url: https://example.com/generic.icns\n    sha256: 2222222222222222222222222222222222222222222222222222222222222222\n  \"30\":\n    url: https://example.com/e30.icns\n    sha256: 1111111111111111111111111111111111111111111111111111111111111111","handlingStrategy":"validation","validationCode":"# Mirror of BuildConfig.version_map?: a hash that is NOT a {url, sha256} spec\ndef version_map?(v)\n  v.is_a?(Hash) && !(v.keys.map(&:to_s) - %w[url sha256]).empty?\nend\n\nicon = config_hash[\"icon\"]\nif version_map?(icon)\n  icon.each do |ver, spec|\n    abort \"icon.#{ver}: version maps cannot be nested - flatten one level\" if version_map?(spec)\n  end\nend","typeGuard":"def icon_shape_ok?(icon)\n  spec_map = ->(v) { v.is_a?(Hash) && !(v.keys.map(&:to_s) - %w[url sha256]).empty? }\n  return true unless spec_map.call(icon)\n  icon.values.none? { |v| spec_map.call(v) }\nend","tryCatchPattern":"begin\n  BuildConfig.load_config\nrescue BuildConfig::ConfigurationError => e\n  if e.message.include?(\"Version maps cannot be nested\")\n    abort \"Flatten icon: one level of version keys, each mapping to a name or {url, sha256}\"\n  end\n  raise\nend","preventionTips":["Memorize the schema: icon -> version key -> spec. Exactly two hops, never three","Keep 'default' a sibling of the version keys, not nested under one","Use a YAML LSP so indentation mistakes show as you type","Prefer the simple flat form (icon: Name) unless you truly need per-version icons"],"tags":["configuration","icon","version-map","yaml-structure","emacs-plus"],"backgroundTag":"invalid-config-nesting","analyzedSha":"01c47fe98f35ff28a37a89e1f7aafadff621f9e0","analyzedAt":"2026-08-23T16:25:45.065Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}