Skip to content
Latchkey

Rollup "Could not resolve entry module" in CI

Rollup could not find the input file you configured. The input path is wrong, the file is missing, or CI runs from a different working directory than expected, so the entry does not resolve.

What this error means

The build fails immediately with "[!] RollupError: Could not resolve entry module 'src/index.js'." before any module is processed.

rollup
[!] RollupError: Could not resolve entry module "src/index.js".
    at error (node_modules/rollup/dist/shared/parseAst.js:...)

Common causes

A wrong or stale input path

The input in the config points to a file that was renamed, moved, or never existed at that path.

CI runs from the wrong working directory

A relative input resolves against the job's cwd; if the build runs from a subdirectory or repo root differently than locally, the path misses.

How to fix it

Point input at the real entry file

  1. Confirm the entry file exists at the configured path.
  2. Fix the input value or the working directory of the build step.
  3. Re-run so Rollup resolves the entry.
rollup.config.js
// rollup.config.js
export default { input: 'src/index.js', output: { file: 'dist/bundle.js' } };

Set the working directory in the CI step

Run the build from the directory that makes the relative input correct.

.github/workflows/ci.yml
- run: npx rollup -c
  working-directory: packages/lib

How to prevent it

  • Keep input paths in sync with file moves and renames.
  • Set working-directory so relative paths resolve as expected.
  • Verify the build runs from the right cwd in CI, not just locally.

Frequently asked questions

What causes ""Could not resolve entry module""?
The input in the config points to a file that was renamed, moved, or never existed at that path.
How do I fix "Could not resolve entry module"?
Point input at the real entry file

Related guides

References

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