tailwindlabs/tailwindcss · error · Error

Unsupported libc on: ${process.platform}-${process.arch}

Error message

Unsupported libc on: ${process.platform}-${process.arch}

What it means

Patched into lightningcss's native-binding loader. Like [87], it uses detect-libc's familySync() to select a musl/glibc binary and adds a special 'gnueabihf' suffix for arm on glibc. If familySync returns neither MUSL nor GLIBC, it throws. Non-Linux platforms hit the win32/default branches instead.

Source

Thrown at patches/lightningcss@1.33.0.patch:39

+      if (process.arch === 'arm') {
+        return require(`lightningcss-${process.platform}-${process.arch}-gnueabihf`)
+      } else {
+        return require(`lightningcss-${process.platform}-${process.arch}-gnu`)
+      }
+    } else {
+      let { MUSL, GLIBC, familySync } = require('detect-libc')
+      let family = familySync()
+
+      if (family === MUSL) {
+        return require(`lightningcss-${process.platform}-${process.arch}-musl`)
+      } else if (family === GLIBC) {
+        if (process.arch === 'arm') {
+          return require(`lightningcss-${process.platform}-${process.arch}-gnueabihf`)
+        } else {
+          return require(`lightningcss-${process.platform}-${process.arch}-gnu`)
+        }
+      } else {
+        throw new Error(`Unsupported libc on: ${process.platform}-${process.arch}`)
+      }
+    }
+  } else if (process.platform === 'win32') {
+    return require(`lightningcss-${process.platform}-${process.arch}-msvc`)
   } else {
-    parts.push('gnu');
+    return require(`lightningcss-${process.platform}-${process.arch}`)
   }
-} else if (process.platform === 'win32') {
-  parts.push('msvc');
 }
 
-let native;
-try {
-  native = require(`lightningcss-${parts.join('-')}`);
-} catch (err) {
-  native = require(`../lightningcss.${parts.join('-')}.node`);
-}

View on GitHub (pinned to 16e94cbf7f)

Solutions

  1. Check the detected family: 'node -e "console.log(require('detect-libc').familySync())"'.
  2. Install the matching platform binary explicitly (e.g. lightningcss-linux-x64-gnu or lightningcss-linux-arm64-musl).
  3. For arm-glibc, ensure lightningcss-linux-arm-gnueabihf is available and resolvable.
  4. Run in a standard glibc or musl container; upgrade detect-libc if it misreports.

Example fix

# before — unsupported libc family throws
# after — install the correct prebuilt
npm i lightningcss-linux-x64-gnu
Defensive patterns

Strategy: validation

Validate before calling

const { familySync, MUSL, GLIBC } = require('detect-libc')
const family = familySync()
if (family !== MUSL && family !== GLIBC) {
  throw new Error(`Unsupported libc for lightningcss: ${family}`)
}

Type guard

function lightningcssSupported(family: string | null): boolean {
  return family === 'musl' || family === 'glibc'
}

Try / catch

try {
  const lightningcss = require('lightningcss')
} catch (e) {
  if (/Unsupported libc/.test(e.message)) {
    // use a pure-JS CSS fallback
  }
}

Prevention

When it happens

Trigger: Running lightningcss on Linux where detect-libc reports a family that is neither MUSL nor GLIBC. Most commonly an unsupported or misdetected libc in a minimal container.

Common situations: Alpine (musl) images that work, but mixed-libc environments that don't. armhf targets where the gnueabihf binary is missing. CI runners with stripped-down ld detection. detect-libc version skew.

Related errors


AI-assisted analysis of tailwindlabs/tailwindcss@16e94cbf7f (2026-08-12). Data as JSON: /api/errors/99dcfe0fb0baa9ff. Report an issue: GitHub.