Web build

Rollup failed to resolve import

A package is imported but not installed

Rollup failed to resolve import. The code imports a package that isn’t in package.json — common when an AI builder adds a plugin import without the dependency.

Updated

What this error means

The code imports a package that isn’t in package.json — common when an AI builder adds a plugin import without the dependency.

Why it happens

A source file imports a package that is not listed in package.json, so the bundler cannot resolve it. Builders often add the import and skip the dependency.

The message tools print

[vite]: Rollup failed to resolve import "@capacitor/haptics" from "/home/runner/work/harbor/harbor/src/lib/native.ts".

How to fix it

  1. Install the package named in the error (npm install, then the name) and commit the lockfile.
  2. For Capacitor plugins, run npx cap sync afterwards.

Check a log that shows this

Paste the failing step into the build error explainer. It matches this message, and any others in the same log, in your browser. Nothing is uploaded.

Other Web build errors

Build the web app before the native one

CapWrapp installs dependencies from the lockfile, builds the site, and runs Capacitor sync before the native build, from the GitHub repo you connect.

  • Free to start
  • No credit card
  • Sign in with Google or GitHub