Skip to content
Latchkey

Chromatic "Failed to publish build" in CI

The Chromatic CLI authenticated and started a build but the publish step did not finish, often due to a transient network failure during upload or a build that produced no valid output to send.

What this error means

The step fails with "Failed to publish build" or an upload error after the Storybook was built, sometimes after a partial upload.

chromatic
✖ Failed to publish build
    Error: read ECONNRESET while uploading to Chromatic

Common causes

A transient network drop during upload

The connection to Chromatic dropped mid-upload, so the build could not be finalized.

No valid Storybook output to publish

The build folder was empty or corrupt, so there was nothing complete to publish.

How to fix it

Retry and confirm the build output

  1. Confirm storybook build produced a populated storybook-static.
  2. Re-run the Chromatic step to recover from a transient upload drop.
  3. If it persists, run Chromatic with debug output to see the failing request.
Terminal
npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN --debug

Let Chromatic build Storybook itself

Point Chromatic at a prebuilt directory or let it build, but not a stale empty folder.

Terminal
npx chromatic --storybook-build-dir=storybook-static

How to prevent it

  • Verify the Storybook build succeeds before publishing.
  • Retry transient upload failures rather than treating them as fatal.
  • Use --debug to capture the failing request when it recurs.

Frequently asked questions

What causes ""Failed to publish build""?
The connection to Chromatic dropped mid-upload, so the build could not be finalized.
How do I fix "Failed to publish build"?
Retry and confirm the build output

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card