d12frosted/homebrew-emacs-plus · error · ConfigurationError

Invalid 'patches' entry in #{path} Expected: patch name (str

Error message

Invalid 'patches' entry in #{path}
Expected: patch name (string) or named patch with 'url' and 'sha256'
Got: #{entry.inspect} (#{entry.class})

What it means

Error "Invalid 'patches' entry in #{path} Expected: patch name (string) or named patch with 'url' and 'sha256' Got: #{entry.inspect} (#{entry.class})" thrown in d12frosted/homebrew-emacs-plus.

Source

Thrown at Library/BuildConfig.rb:298

      end

      patches.each do |entry|
        case entry
        when String
          # Valid: patch name from registry
        when Hash
          entry.each do |name, value|
            if version_map?(value) && !value.empty?
              validate_version_map_keys!(value, "patches.#{name}", path)
              value.each do |ver, spec|
                validate_patch_spec!(spec, path, key: "patches.#{name}.#{ver}")
              end
            else
              validate_patch_spec!(value, path, key: "patches.#{name}")
            end
          end
        else
          raise ConfigurationError,
            "Invalid 'patches' entry in #{path}\n" \
            "Expected: patch name (string) or named patch with 'url' and 'sha256'\n" \
            "Got: #{entry.inspect} (#{entry.class})"
        end
      end
    end

    def validate_patch_spec!(spec, path, key:)
      return if spec.is_a?(Hash) && spec["url"] && spec["sha256"]

      raise ConfigurationError,
        "Invalid '#{key}' in #{path}\n" \
        "External and local patches require both 'url' and 'sha256'.\n" \
        "Got: #{spec.inspect}"
    end

    def validate_revision!(revision, path)
      case revision

View on GitHub (pinned to 01c47fe98f)

Solutions

  1. Each entry in 'patches' must be either a plain patch name string (e.g. '- frame-transparency') or a named patch map with 'url' and 'sha256' keys.
  2. For a custom patch, use the map form: patches: - my-patch: url: https://example.com/my.patch sha256: <hex digest>
  3. Remove or fix entries that are numbers, nested lists, or other non-string/non-map values.

When it happens

Trigger: Thrown at Library/BuildConfig.rb:298 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of d12frosted/homebrew-emacs-plus@01c47fe98f (2026-08-23). Data as JSON: /api/errors/298519f4f2e78ead. Report an issue: GitHub.