{"record":{"id":"a1b30646d94cac3a","repo":"d12frosted/homebrew-emacs-plus","slug":"yaml-syntax-error-in-path-e-message-tip-va","errorCode":null,"errorMessage":"YAML syntax error in #{path}\n#{e.message}\n\nTip: Validate your YAML at https://yamlchecker.com/","messagePattern":"YAML syntax error in #(.+?)\n#(.+?)\n\nTip: Validate your YAML at https://yamlchecker\\.com/","errorType":"validation","errorClass":"ConfigurationError","httpStatus":null,"severity":"error","filePath":"Library/BuildConfig.rb","lineNumber":72,"sourceCode":"        if config_file\n          config = load_and_validate_yaml(config_file)\n          config_source = config_file\n        end\n      end\n\n      { config: config || {}, source: config_source }\n    end\n\n    # Load YAML file and validate its structure\n    # Returns empty hash for empty files, raises ConfigurationError for invalid configs\n    def load_and_validate_yaml(path)\n      content = File.read(path)\n      return {} if content.strip.empty?\n\n      begin\n        config = YAML.safe_load(content, permitted_classes: [Symbol])\n      rescue Psych::SyntaxError => e\n        raise ConfigurationError,\n          \"YAML syntax error in #{path}\\n\" \\\n          \"#{e.message}\\n\\n\" \\\n          \"Tip: Validate your YAML at https://yamlchecker.com/\"\n      end\n\n      validate_config!(config, path)\n      config\n    end\n\n    # True if value is an external resource spec: {url, sha256}\n    def external_spec?(value)\n      value.is_a?(Hash) && !value.empty? && (value.keys.map(&:to_s) - SPEC_KEYS).empty?\n    end\n\n    # True if value is a version map: a hash keyed by major version/\"default\"\n    def version_map?(value)\n      value.is_a?(Hash) && !external_spec?(value)\n    end","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/d12frosted/homebrew-emacs-plus/blob/01c47fe98f35ff28a37a89e1f7aafadff621f9e0/Library/BuildConfig.rb#L54-L90","documentation":"BuildConfig could not parse the YAML in the file named in the message (the build.yml picked by load_config: $HOMEBREW_EMACS_PLUS_BUILD_CONFIG, ~/.config/emacs-plus/build.yml, or ~/.emacs-plus-build.yml). YAML.safe_load raised Psych::SyntaxError, and the rescue at Library/BuildConfig.rb:69-76 re-raised it as BuildConfig::ConfigurationError, embedding the parser's original message (with line and column) plus a validation-tip link. It fires before any structure validation, so a single bad character anywhere in the file aborts the whole emacs-plus install/build.","triggerScenarios":"Calling BuildConfig.load_config (directly or via `brew install/reinstall emacs-plus` or the cask postflight) when the config file contains invalid YAML: tab characters used for indentation, an unclosed quote or bracket, a stray ':' or '-' placement, or a duplicate key. Any of these makes Psych::SyntaxError throw inside safe_load before validate_config! ever runs.","commonSituations":"Hand-editing build.yml in an editor that inserts tabs (YAML allows only spaces); pasting snippets from websites or chat UIs that introduce smart quotes, curly apostrophes, or non-breaking spaces; a truncated or half-synced file from a dotfiles manager. A comments-only file does NOT hit this (it parses to nil and triggers the mapping error instead).","solutions":["Open the path shown in the message and jump to the line/column Psych reports - fix that exact spot first.","Replace all tab indentation with spaces, and any smart quotes/curly characters with straight ASCII ones.","Validate the file: paste it into https://yamlchecker.com/ or run `ruby -ryaml -e 'YAML.safe_load(File.read(ARGV[0]))' ~/.config/emacs-plus/build.yml` - silence means the syntax is clean.","If you cannot spot it, start from an empty file (an empty file is valid and means 'no config') and re-add keys one at a time until the error reappears."],"exampleFix":"# before (unclosed quote, tab indentation)\nicon: \"Spacemacs\n\turl: https://example.com/icns\n\n# after (plain string, no tab needed)\nicon: Spacemacs","handlingStrategy":"try-catch","validationCode":"# Pre-parse the config exactly like BuildConfig does, before running brew\nrequire \"yaml\"\npath = ENV[\"HOMEBREW_EMACS_PLUS_BUILD_CONFIG\"] || \"#{Etc.getpwuid.dir}/.config/emacs-plus/build.yml\"\nif File.exist?(path)\n  begin\n    YAML.safe_load(File.read(path), permitted_classes: [Symbol])\n  rescue Psych::SyntaxError => e\n    abort \"Fix build.yml first: #{e.message}\"\n  end\nend","typeGuard":null,"tryCatchPattern":"begin\n  result = BuildConfig.load_config\nrescue BuildConfig::ConfigurationError => e\n  warn \"build.yml rejected: #{e.message}\"\n  abort \"Edit the file named above, validate at https://yamlchecker.com/, then retry\"\nend","preventionTips":["Enable a YAML language server (e.g. redhat.vscode-yaml) so syntax errors surface while typing","Configure your editor to insert spaces, never tabs, in .yml files","Run a one-line YAML.safe_load check over build.yml in your dotfiles install script before invoking brew","Keep the file pure ASCII - smart quotes and non-breaking spaces from copy-paste are the classic invisible culprit"],"tags":["yaml","configuration","syntax-error","emacs-plus","homebrew"],"backgroundTag":"yaml-syntax-error","analyzedSha":"01c47fe98f35ff28a37a89e1f7aafadff621f9e0","analyzedAt":"2026-08-23T16:25:45.065Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}