PostCSS "postcss-import: Failed to find" in CI
The postcss-import plugin inlines @import rules by resolving each path. "Failed to find" means an imported stylesheet path does not exist relative to the resolver's search roots in CI.
What this error means
The CSS build fails with "Failed to find './components/buttons.css' in [ ... ]" listing the directories postcss-import searched.
Error: Failed to find './components/buttons.css'
in [
/home/runner/work/app/app/src/styles
]Common causes
The import path is wrong or the file is uncommitted
The @import points at a file that does not exist in the checkout, often a path that worked locally but is gitignored or misspelled.
Case sensitivity on the runner
A path like Buttons.css imported as buttons.css resolves on a case-insensitive local disk but fails on a Linux runner.
How to fix it
Correct the import path
- Read the searched directories in the error.
- Fix the
@importto a path that exists relative to those roots, matching case exactly. - Re-run the build.
/* match the real file path and case */
@import './components/buttons.css';Add a resolve search path
If imports come from a shared directory, configure postcss-import with the search path so it resolves consistently.
// postcss.config.js
export default { plugins: { 'postcss-import': { path: ['src/styles'] } } };How to prevent it
- Commit every stylesheet referenced by
@import. - Match import path casing to the real filenames for case-sensitive runners.
- Configure postcss-import search paths for shared style directories.