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.
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 buildCommon 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
- Set up Node and run yarn install (or npm ci) before assets.
- Run assets:precompile so the manifest is generated.
- Read the bundler log if precompile still fails.
yarn install --frozen-lockfile
bundle exec rails assets:precompileProvision Node alongside Ruby
Add a Node setup step so the asset bundler can run in CI.
- 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.