Astro integration "[astro] failed" (missing integration) in CI
Astro loads integrations listed in astro.config at build start. If an integration package is referenced but not installed on the runner, the config fails to load and the build errors before compiling any page.
What this error means
The build fails at startup with a "Cannot find package '@astrojs/...'" or an "[astro] ... failed" message pointing at an integration in the config.
astro
[astro] Cannot find package '@astrojs/mdx' imported from
/home/runner/work/site/astro.config.mjs
Did you forget to install the integration? Run: npx astro add mdxCommon causes
The integration package is not installed
The config imports an integration, but the package was never added to dependencies or was dropped by a --production install.
A version mismatch with the Astro core
An integration built for a different major of Astro can fail to load against the installed core.
How to fix it
Add the integration properly
- Run
astro add <name>(or install the package) so it is in dependencies. - Commit the updated lockfile so CI installs it.
- Re-run the build.
Terminal
npx astro add mdxAlign integration and core versions
Match the integration major to the Astro core major, then reinstall.
Terminal
npm install astro@latest @astrojs/mdx@latestHow to prevent it
- Add integrations with
astro addso the dependency is recorded. - Commit the lockfile after adding integrations.
- Keep integrations aligned with the Astro core major.
Related guides
Astro "Cannot find package 'astro'" in CIFix Astro "Cannot find package 'astro'" in CI - the astro package is not installed on the runner, usually bec…
Astro "astro build" failed (build errored) in CIFix "astro build" failing in CI - the build errored while compiling pages, components, or content. The first…
Astro content collection schema (zod) validation failed in CIFix Astro content collection schema errors in CI - frontmatter did not match the zod schema in the collection…