Skip to content
Latchkey

Parcel "@parcel/resolver-default: Cannot find module" in CI

Parcel's default resolver tried to locate an import and failed. The package is not installed, the relative path is wrong, or the case does not match the file on the case-sensitive runner filesystem.

What this error means

The build fails with "@parcel/resolver-default: Cannot find module 'X'" or "Failed to resolve 'X' from './src/...'" and a code frame on the import.

parcel
@parcel/core: Failed to resolve './utils/format' from './src/index.js'
@parcel/resolver-default: Cannot find module './utils/format'

Common causes

A dependency missing in the CI install

The package was never installed in CI, or a devDependency import was dropped by a production-only install.

A wrong path or case mismatch

The relative path does not exist, or its case differs from the real file name on a case-sensitive runner.

How to fix it

Install the dependency or fix the path

  1. Confirm the package or file exists with the exact name and case.
  2. Install missing packages or correct the import path.
  3. Re-run the Parcel build to confirm resolution.
Terminal
npm ci
npx parcel build src/index.html

Clear the Parcel cache if it is stale

A stale .parcel-cache can keep referencing a moved module; clearing it forces a clean resolve.

Terminal
rm -rf .parcel-cache
npx parcel build src/index.html

How to prevent it

  • Commit a lockfile so CI installs every imported package.
  • Match import paths to real file names and case.
  • Avoid caching .parcel-cache across incompatible changes.

Frequently asked questions

What causes ""@parcel/resolver-default: Cannot find module""?
The package was never installed in CI, or a devDependency import was dropped by a production-only install.
How do I fix "@parcel/resolver-default: Cannot find module"?
Install the dependency or fix the path

Related guides

References

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