Ten Ways Breaking Changes Slip Into "Safe" Releases

Few maintainers ship a breaking change in a minor on purpose. It happens because the change did not look like a break from the inside. The list below collects ten patterns that commonly catch package authors out, each with one way to guard against it. The examples are generic and illustrative, not reports about specific projects.

Changes to what can be imported

  1. Removing or renaming an export. The obvious one, still the most frequent. Even an export that was never documented is public if it can be imported. Guard: commit an API report and diff it in CI.
  2. Adding an exports map. It blocks every deep import path that is not listed. Node.js itself warns that introducing it can be breaking. Guard: treat it as a major, or include a wildcard pattern for old paths.
  3. Switching module format. Going ESM-only means CommonJS callers using require() can no longer load the package in many runtime versions. Guard: test both import styles against the packed tarball.
  4. Forgetting files in the tarball. A new files allowlist or .npmignore rule silently drops a directory users reference. Guard: run npm pack --dry-run and review the file list.

Changes to behaviour

  1. Changing a default. Same signature, different result. Guard: introduce the new behaviour behind an option first and flip it in a major.
  2. Throwing where you used to return. Turning a null return into an exception is "stricter" but breaks every caller that checked for null. Guard: list error behaviour in your API docs and treat it as contract.
  3. Making something async. Returning a promise instead of a value changes every call site. Guard: add a new async function alongside the sync one.
  4. Changing output format or ordering. Consumers parse log lines, sort orders and error messages more often than authors expect, a pattern often summarised as Hyrum's Law. Guard: decide which outputs are stable and say so.

Changes to the environment

  1. Raising the runtime floor. Using a newer language feature without updating engines or requires-python leads to syntax errors on old runtimes. Guard: test on the lowest version your metadata claims.
  2. Tightening a peer or dependency range. Users on the older host or dependency major can no longer install. Guard: narrowing a range is a major; widening is a minor.

Using the list

Turn the ten items into release-review questions. Before tagging, ask whoever prepared the release to answer each one with "no" or "yes, and here is why it is still compatible". It takes a couple of minutes and catches most of the cases above. If an answer is "yes, and it is not compatible", the release is a major, whatever the commit messages say.

Worked examples of several items are on this site: a removed default export, adding exports, changing a default safely and a missing requires-python bound.