parcel-bundler/parcel · error · Error

A Parcel link could not be found!

Error message

A Parcel link could not be found!

What it means

Thrown by the `parcel-link unlink` command when no `.parcel-link` config file is found in the current working directory (appRoot). `ParcelLinkConfig.load` is wrapped in a try/catch that swallows the error, so `parcelLinkConfig` stays undefined and the command refuses to run. The message tells you there is nothing to undo because no link was ever established here.

Source

Thrown at packages/dev/parcel-link/src/unlink.js:164

      let appRoot = process.cwd();

      let parcelLinkConfig;
      try {
        parcelLinkConfig = await ParcelLinkConfig.load(appRoot, {fs});
      } catch (e) {
        // boop!
      }

      if (parcelLinkConfig) {
        await action(parcelLinkConfig, {
          dryRun: options.dryRun,
          forceInstall: options.forceInstall,
          log,
        });

        if (!options.dryRun) await parcelLinkConfig.delete();
      } else {
        throw new Error('A Parcel link could not be found!');
      }

      log('🎉 Unlinking successful');
    });
}

View on GitHub (pinned to 59484858a1)

Solutions

  1. Verify you are in the app root that was originally linked: `ls -la .parcel-link` — the file must exist.
  2. If you already unlinked (or the file is gone), there is nothing to do; the unlink is a no-op goal and you can ignore the error.
  3. If you are in the wrong directory, `cd` to the directory that contains `.parcel-link` and re-run `parcel-link unlink`.
  4. If you want to unlink a stale link whose config file was lost, manually restore node_modules with `yarn install --force` (or your package manager equivalent).

Example fix

// before (wrong cwd)
$ cd packages/app/src && parcel-link unlink
// after
$ cd /path/to/app-root
$ parcel-link unlink
Defensive patterns

Strategy: validation

Validate before calling

import fs from 'fs';
function canUnlink(appRoot) {
  return fs.existsSync(`${appRoot}/.parcel-link`);
}
if (!canUnlink(process.cwd())) {
  console.error('No .parcel-link in cwd — nothing to unlink.');
  process.exit(0);
}

Prevention

When it happens

Trigger: Running `parcel-link unlink` (or `unlink`) in a directory where `parcel-link link` was never run, or where the `.parcel-link` file was already deleted. Also when running from the wrong directory (not the app root that contains the link).

Common situations: Running unlink after manually deleting `.parcel-link`; running it from a subdirectory rather than the app root; CI or a fresh clone where the link was never set up; double-running unlink (the second invocation finds nothing).

Related errors


AI-assisted analysis of parcel-bundler/parcel@59484858a1 (2026-08-13). Data as JSON: /api/errors/94b472f68ab1f4fb. Report an issue: GitHub.