Skip to content
Latchkey

Rails webpacker / jsbundling Build Fails in CI

The JavaScript build that webpacker (or jsbundling-rails / esbuild / rollup) drives failed, so Rails cannot find the compiled packs. Usually yarn install or the JS build step did not run, or Node is the wrong version.

What this error means

CI fails with webpacker "Webpacker can’t find application.js in manifest.json", or jsbundling’s yarn build erroring, or a Node version error. The Ruby side is fine; the JS asset build did not complete.

CI log
Webpacker::Manifest::MissingEntryError: Webpacker can't find
application.js in /app/public/packs/manifest.json

# jsbundling variant
yarn run build exited with non-zero code: 1

Common causes

JS dependencies / build step not run

webpacker and jsbundling expect yarn install and a JS build (yarn build, webpack, esbuild) before assets are available. Skipping either leaves no compiled packs, so the manifest entry is missing.

Node version mismatch

A Node version different from what the project expects breaks the JS build (incompatible loaders, syntax). The build exits non-zero before producing the manifest.

How to fix it

Install Node and run the JS build

Set up the right Node, install JS deps, then compile packs (precompile triggers the JS build for jsbundling).

.github/workflows/ci.yml
- uses: actions/setup-node@v4
  with:
    node-version: '20'
- run: yarn install --frozen-lockfile
- run: bundle exec rails assets:precompile   # runs yarn build for jsbundling

For webpacker, compile packs explicitly

Terminal
bundle exec rails webpacker:compile
# confirm the manifest now lists the entry
cat public/packs/manifest.json

How to prevent it

  • Set up Node and run yarn install before the Rails asset build.
  • Pin the Node version to what the project’s JS toolchain expects.
  • Cache node_modules/yarn keyed on yarn.lock to speed and stabilize the build.

Related guides

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