Skip to content
Latchkey

Rollup "Could not resolve entry module" - Fix the Input Path in CI

Rollup could not find the entry file named by input. The path is wrong, the file is missing in CI, or Rollup is running from a different working directory than the path assumes.

What this error means

Rollup aborts before bundling with [!] RollupError: Could not resolve entry module "<input>". It is deterministic - the entry path simply does not resolve.

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

Common causes

Wrong or stale input path

The input in rollup.config.js (or --input) points at a file that was moved, renamed, or never existed at that path.

Wrong cwd or partial checkout in CI

Rollup runs from a different directory than expected, or a sparse/shallow checkout omits the entry file, so the relative path resolves to nothing.

How to fix it

Point input at the real entry file

Set input to the path that actually exists from the project root.

rollup.config.js
// rollup.config.js
export default {
  input: 'src/index.ts', // must exist relative to cwd
  output: { file: 'dist/bundle.js', format: 'es' },
}

Run from the right directory and verify the file

  1. Confirm cwd and that the entry exists: ls -la src/index.ts.
  2. Run Rollup from the project root so relative input resolves.
  3. Check the CI checkout actually contains the entry file.

How to prevent it

  • Keep input aligned with the real source layout.
  • Run Rollup from a consistent working directory in CI.
  • Ensure the checkout includes the entry file the config references.

Frequently asked questions

What causes ""Could not resolve entry module""?
The input in rollup.config.js (or --input) points at a file that was moved, renamed, or never existed at that path.
How do I fix "Could not resolve entry module"?
Set input to the path that actually exists from the project root.

Related guides

References

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