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.
[!] 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
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
- Confirm cwd and that the entry exists:
ls -la src/index.ts. - Run Rollup from the project root so relative
inputresolves. - Check the CI checkout actually contains the entry file.
How to prevent it
- Keep
inputaligned with the real source layout. - Run Rollup from a consistent working directory in CI.
- Ensure the checkout includes the entry file the config references.