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.
[!] 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
- Confirm the entry file exists at the configured path.
- Fix the
inputvalue or the working directory of the build step. - Re-run so Rollup resolves the entry.
// 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.
- run: npx rollup -c
working-directory: packages/libHow to prevent it
- Keep
inputpaths in sync with file moves and renames. - Set
working-directoryso relative paths resolve as expected. - Verify the build runs from the right cwd in CI, not just locally.