Skip to content
Latchkey

Symfony AssetMapper / importmap asset not found in CI

AssetMapper could not resolve an asset referenced from a template or importmap because the vendored files under assets/vendor were never installed, or the compiled manifest was not built before rendering in CI.

What this error means

A page render or asset-map:compile fails with "Unable to find asset ..." or "The "importmap" ... references a package that has not been installed", often after a fresh checkout.

Symfony
In ImportMapManager.php line 320:
  The importmap entry "bootstrap" references a package that has not been downloaded.
  Run "php bin/console importmap:install" to download it.

Common causes

Vendored assets were not installed

assets/vendor is typically gitignored, so a fresh CI checkout has no downloaded packages until importmap:install runs.

The asset map was not compiled

For a production-like render, asset-map:compile must run first; without it the manifest and hashed files are missing.

How to fix it

Install and compile assets before tests or build

  1. Run importmap:install to download vendored packages.
  2. Run asset-map:compile if the app renders compiled asset paths.
  3. Re-run the render or test.
Terminal
php bin/console importmap:install
php bin/console asset-map:compile

Build front-end assets when using Webpack Encore

If the project uses Encore instead of AssetMapper, install and build the bundle before the app expects the manifest.

Terminal
npm ci
npm run build

How to prevent it

  • Run importmap:install (or npm run build for Encore) as a CI step before rendering.
  • Cache assets/vendor or node_modules between runs to speed installs.
  • Do not commit compiled asset output; build it deterministically in CI.

Frequently asked questions

What causes ""asset ... not found in importmap""?
assets/vendor is typically gitignored, so a fresh CI checkout has no downloaded packages until importmap:install runs.
How do I fix "asset ... not found in importmap"?
Install and compile assets before tests or build

Related guides

References

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