parcel-bundler/parcel · critical · Error

Unsupported OS: ${platform}, architecture: ${arch}

Error message

Unsupported OS: ${platform}, architecture: ${arch}

What it means

Thrown by @parcel/rust's binding loader when process.platform is not one of android, win32, darwin, or freebsd/linux. The top-level switch has no case for the current platform, so it falls to default and reports both platform and arch to aid diagnosis.

Source

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

        localFileExisted = existsSync(
          join(__dirname, 'parcel-node-bindings.linux-s390x-gnu.node'),
        );
        try {
          if (localFileExisted) {
            nativeBinding = require('./parcel-node-bindings.linux-s390x-gnu.node');
          } else {
            nativeBinding = require('@parcel/rust-linux-s390x-gnu');
          }
        } catch (e) {
          loadError = e;
        }
        break;
      default:
        throw new Error(`Unsupported architecture on Linux: ${arch}`);
    }
    break;
  default:
    throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`);
}

if (!nativeBinding) {
  if (loadError) {
    throw loadError;
  }
  throw new Error(`Failed to load native binding`);
}

const {
  findAncestorFile,
  findFirstFile,
  findNodeModule,
  hashString,
  hashBuffer,
  Hash,
  optimizeImage,
  transformHtml,

View on GitHub (pinned to 59484858a1)

Solutions

  1. Move the build to a supported OS (linux, darwin, win32) via a container or VM.
  2. Check `node -p process.platform` to confirm what Node detects; fix the environment if misreported.
  3. Build the native binding from source if a Rust toolchain exists for your OS.
  4. Request upstream support or track the platform-compat issue.

Example fix

# before: OpenBSD
$ node -p process.platform
'openbsd'  # error: Unsupported OS

# after: build inside linux container
$ docker run --rm -v "$PWD":/work -w /work node:20 parcel build
Defensive patterns

Strategy: validation

Validate before calling

import { platform } from 'process';
const SUPPORTED_OS = new Set(['linux','darwin','win32','freebsd','android']);
if (!SUPPORTED_OS.has(platform)) {
  throw new Error(`Unsupported OS ${platform}; run Parcel in a linux/darwin/win32 VM.`);
}

Type guard

type SupportedPlatform = 'linux'|'darwin'|'win32'|'freebsd'|'android';
function isSupportedPlatform(p: string): p is SupportedPlatform {
  return ['linux','darwin','win32','freebsd','android'].includes(p);
}

Prevention

When it happens

Trigger: Running Parcel on an OS Node reports as something other than the supported set — e.g. 'aix', 'sunos', 'openbsd', 'netbsd', 'haiku', or a future/new platform string.

Common situations: Building on AIX/Solaris/BSD-other servers; experimental OS ports; CI on uncommon OS images; Node reporting a nonstandard platform due to a shim.

Related errors


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