vercel/next.js · error

experimental.useLightningcss is set, but the setting is disa

Error message

experimental.useLightningcss is set, but the setting is disabled because next-swc/wasm does not support it yet.

What it means

Config warning during load: experimental.useLightningcss is enabled, but the loaded next-swc bindings (the wasm variant, checked via loadBindings and its css.lightning capability) do not support Lightning CSS yet. The setting is therefore disabled and ignored; the warning tells the user the wasm binary is the reason rather than a config mistake.

Source

Thrown at packages/next/src/server/config.ts:2181

    ) {
      curLog.warn(
        `experimental.lightningCssFeatures is set but experimental.useLightningcss is not enabled. ` +
          `The lightningCssFeatures option has no effect without useLightningcss.`
      )
    }

    if (
      phase !== PHASE_PRODUCTION_SERVER &&
      userConfig.experimental?.useLightningcss
    ) {
      const { loadBindings } =
        require('../build/swc') as typeof import('../build/swc')
      const isLightningSupported = (
        await loadBindings(userConfig.experimental?.useWasmBinary)
      )?.css?.lightning

      if (!isLightningSupported) {
        curLog.warn(
          `experimental.useLightningcss is set, but the setting is disabled because next-swc/wasm does not support it yet.`
        )
        userConfig.experimental.useLightningcss = false
      }
    }

    // serialize the regex config into string
    if (userConfig?.htmlLimitedBots instanceof RegExp) {
      // @ts-expect-error: override the htmlLimitedBots with default string, type covert: RegExp -> string
      userConfig.htmlLimitedBots = userConfig.htmlLimitedBots.source
    }

    enforceExperimentalFeatures(userConfig, {
      isDefaultConfig: false,
      configuredExperimentalFeatures,
      debugPrerender,
      phase,
    })

View on GitHub (pinned to 258b1c1bc0)

Solutions

  1. Use the native next-swc binary instead of the wasm build to enable experimental.useLightningcss.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/next/src/server/config.ts:2136 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vercel/next.js@258b1c1bc0 (2026-08-19). Data as JSON: /api/errors/7ce1fff3bc98adb5. Report an issue: GitHub.