{"record":{"id":"99dcfe0fb0baa9ff","repo":"tailwindlabs/tailwindcss","slug":"unsupported-libc-on-process-platform-process-99dcfe","errorCode":null,"errorMessage":"Unsupported libc on: ${process.platform}-${process.arch}","messagePattern":"Unsupported libc on: (.+?)-(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"patches/lightningcss@1.33.0.patch","lineNumber":39,"sourceCode":"+      if (process.arch === 'arm') {\n+        return require(`lightningcss-${process.platform}-${process.arch}-gnueabihf`)\n+      } else {\n+        return require(`lightningcss-${process.platform}-${process.arch}-gnu`)\n+      }\n+    } else {\n+      let { MUSL, GLIBC, familySync } = require('detect-libc')\n+      let family = familySync()\n+\n+      if (family === MUSL) {\n+        return require(`lightningcss-${process.platform}-${process.arch}-musl`)\n+      } else if (family === GLIBC) {\n+        if (process.arch === 'arm') {\n+          return require(`lightningcss-${process.platform}-${process.arch}-gnueabihf`)\n+        } else {\n+          return require(`lightningcss-${process.platform}-${process.arch}-gnu`)\n+        }\n+      } else {\n+        throw new Error(`Unsupported libc on: ${process.platform}-${process.arch}`)\n+      }\n+    }\n+  } else if (process.platform === 'win32') {\n+    return require(`lightningcss-${process.platform}-${process.arch}-msvc`)\n   } else {\n-    parts.push('gnu');\n+    return require(`lightningcss-${process.platform}-${process.arch}`)\n   }\n-} else if (process.platform === 'win32') {\n-  parts.push('msvc');\n }\n \n-let native;\n-try {\n-  native = require(`lightningcss-${parts.join('-')}`);\n-} catch (err) {\n-  native = require(`../lightningcss.${parts.join('-')}.node`);\n-}","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/tailwindlabs/tailwindcss/blob/16e94cbf7f965c5ad697e90e940b5e178efad67c/patches/lightningcss@1.33.0.patch#L21-L57","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the detected family: 'node -e \"console.log(require('detect-libc').familySync())\"'.","Install the matching platform binary explicitly (e.g. lightningcss-linux-x64-gnu or lightningcss-linux-arm64-musl).","For arm-glibc, ensure lightningcss-linux-arm-gnueabihf is available and resolvable.","Run in a standard glibc or musl container; upgrade detect-libc if it misreports."],"exampleFix":"# before — unsupported libc family throws\n# after — install the correct prebuilt\nnpm i lightningcss-linux-x64-gnu","handlingStrategy":"validation","validationCode":"const { familySync, MUSL, GLIBC } = require('detect-libc')\nconst family = familySync()\nif (family !== MUSL && family !== GLIBC) {\n  throw new Error(`Unsupported libc for lightningcss: ${family}`)\n}","typeGuard":"function lightningcssSupported(family: string | null): boolean {\n  return family === 'musl' || family === 'glibc'\n}","tryCatchPattern":"try {\n  const lightningcss = require('lightningcss')\n} catch (e) {\n  if (/Unsupported libc/.test(e.message)) {\n    // use a pure-JS CSS fallback\n  }\n}","preventionTips":["Pin the correct prebuilt lightningcss platform binary.","For arm-glibc, ensure lightningcss-linux-arm-gnueabihf is installed.","Validate the libc family in CI before relying on native bindings."],"tags":["lightningcss","native-binding","libc","platform","patch"],"backgroundTag":null,"analyzedSha":"16e94cbf7f965c5ad697e90e940b5e178efad67c","analyzedAt":"2026-08-12T06:02:42.469Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}