parcel-bundler/parcel · critical · Error

Unsupported architecture on FreeBSD: ${arch}

Error message

Unsupported architecture on FreeBSD: ${arch}

What it means

Thrown by @parcel/rust's binding loader on FreeBSD when process.arch is not 'x64'. FreeBSD is only supported on x86-64; the loader explicitly checks `arch !== 'x64'` before attempting to require the freebsd-x64 binding and rejects all other arches.

Source

Thrown at packages/core/rust/index.js:164

          join(__dirname, 'parcel-node-bindings.darwin-arm64.node'),
        );
        try {
          if (localFileExisted) {
            nativeBinding = require('./parcel-node-bindings.darwin-arm64.node');
          } else {
            nativeBinding = require('@parcel/rust-darwin-arm64');
          }
        } catch (e) {
          loadError = e;
        }
        break;
      default:
        throw new Error(`Unsupported architecture on macOS: ${arch}`);
    }
    break;
  case 'freebsd':
    if (arch !== 'x64') {
      throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
    }
    localFileExisted = existsSync(
      join(__dirname, 'parcel-node-bindings.freebsd-x64.node'),
    );
    try {
      if (localFileExisted) {
        nativeBinding = require('./parcel-node-bindings.freebsd-x64.node');
      } else {
        nativeBinding = require('@parcel/rust-freebsd-x64');
      }
    } catch (e) {
      loadError = e;
    }
    break;
  case 'linux':
    switch (arch) {
      case 'x64':
        if (isMusl()) {

View on GitHub (pinned to 59484858a1)

Solutions

  1. Run Parcel on FreeBSD/amd64 (x64) — confirm `node -p process.arch` returns 'x64'.
  2. Move the build to a Linux x64 host where prebuilt coverage is broader.
  3. Build the Rust binding from source on your FreeBSD arch if the toolchain supports it.
  4. Use a Docker/jail environment with FreeBSD x64.

Example fix

# before: FreeBSD/arm64
$ node -p process.arch
'arm64'  # error

# after: FreeBSD/amd64
$ node -p process.arch
'x64'
Defensive patterns

Strategy: validation

Validate before calling

import { platform, arch } from 'process';
if (platform === 'freebsd' && arch !== 'x64') {
  throw new Error(`FreeBSD requires x64; detected ${arch}.`);
}

Type guard

function isSupportedFreeBSDArch(a: string): boolean {
  return a === 'x64';
}

Prevention

When it happens

Trigger: Running Parcel on FreeBSD with a non-x64 architecture (e.g. arm64, riscv64, i386) where no prebuilt parcel-node-bindings.freebsd-x64.node is applicable.

Common situations: Running on FreeBSD ARM64 servers or single-board devices; using i386 FreeBSD jails; community FreeBSD ports on Tier-2 architectures.

Related errors


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