Skip to content
Latchkey

Rails "assets:precompile" / Webpacker build failed in CI

rails assets:precompile runs the JavaScript bundler (Webpacker, jsbundling, or sprockets) and it failed: the bundler exited non-zero, or it produced no manifest entry for an asset a view references. The build log above the Rake failure has the real cause.

What this error means

assets:precompile fails with "Webpacker::Manifest::MissingEntryError: Webpacker can't find application.js in ..." or a non-zero exit from yarn/webpack during precompile.

bundler
Webpacker::Manifest::MissingEntryError: Webpacker can't find application.js in
/home/runner/work/app/app/public/packs/manifest.json. Possible causes:
  1. You forgot to run webpack/yarn build

Common causes

JavaScript dependencies were not installed

The job ran precompile before yarn install / npm ci, so the bundler had no node_modules and produced no manifest.

The JS build failed and left no manifest entry

A webpack/esbuild error during precompile means the referenced pack was never emitted to the manifest.

How to fix it

Install JS deps, then precompile

  1. Set up Node and run yarn install (or npm ci) before assets.
  2. Run assets:precompile so the manifest is generated.
  3. Read the bundler log if precompile still fails.
Terminal
yarn install --frozen-lockfile
bundle exec rails assets:precompile

Provision Node alongside Ruby

Add a Node setup step so the asset bundler can run in CI.

.github/workflows/ci.yml
- uses: actions/setup-node@v4
  with:
    node-version: '20'

How to prevent it

  • Install JS dependencies before assets:precompile.
  • Provision Node in CI for any JS bundling.
  • Read the bundler log to fix the underlying JS error.

Frequently asked questions

What causes ""Webpacker::Manifest::MissingEntryError""?
The job ran precompile before yarn install / npm ci, so the bundler had no node_modules and produced no manifest.
How do I fix "Webpacker::Manifest::MissingEntryError"?
Install JS deps, then precompile

Related guides

References

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