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.
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: 1Common 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).
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: yarn install --frozen-lockfile
- run: bundle exec rails assets:precompile # runs yarn build for jsbundlingFor webpacker, compile packs explicitly
bundle exec rails webpacker:compile
# confirm the manifest now lists the entry
cat public/packs/manifest.jsonHow 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.