Skip to content
Latchkey

semantic-release configuration not found in CI

semantic-release loads its config from .releaserc, release.config.js, or the release key in package.json. When none is present it falls back to defaults, and if the config it does find is malformed it errors out at startup.

What this error means

The run either releases with unexpected defaults, or fails with a config parse error like "Cannot read config file" or invalid JSON in .releaserc.

semantic-release
[semantic-release] > SyntaxError: Unexpected token } in JSON at position 214
    at JSON.parse (<anonymous>)
    at load .releaserc

Common causes

No config file, so defaults apply unexpectedly

Without a config, semantic-release uses default branches and plugins, which may not match your intended release setup.

A malformed config file

A trailing comma or invalid JSON in .releaserc makes the loader throw before any analysis.

How to fix it

Add a valid configuration file

  1. Create a .releaserc with your branches and plugins.
  2. Validate the JSON so it parses cleanly.
  3. Re-run so semantic-release uses the intended config.
.releaserc
{
  "branches": ["main"],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/npm",
    "@semantic-release/github"
  ]
}

Fix or lint the config JSON

Remove trailing commas and validate the file so the loader can parse it.

Terminal
node -e "JSON.parse(require('fs').readFileSync('.releaserc','utf8'))"

How to prevent it

  • Commit an explicit .releaserc so defaults never surprise you.
  • Validate config JSON in CI or a pre-commit hook.
  • Keep the plugin list and branches in one reviewed place.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →