gatsbyjs/gatsby · error · Error

Incompatible DSG/SSR executing environment. Function was bui

Error message

Incompatible DSG/SSR executing environment. Function was built for "${process.env.GATSBY_FUNCTIONS_PLATFORM}/${process.env.GATSBY_FUNCTIONS_ARCH}" but is executing on "${process.platform}/${process.arch}".

To generate engines for "${process.platform}/${process.arch}" run 'gatsby build --functions-platform=${process.platform} --functions-arch=${process.arch}' or run 'gatsby build' with following envirnment variables:

GATSBY_FUNCTIONS_PLATFORM=${process.platform}
GATSBY_FUNCTIONS_ARCH=${process.arch}

What it means

Error "Incompatible DSG/SSR executing environment. Function was built for "${process.env.GATSBY_FUNCTIONS_PLATFORM}/${process.env.GATSBY_FUNCTIONS_ARCH}" but is executing on "${process.platform}/${process.arch}". To generate engines for "${process.platform}/${process.arch}" run 'gatsby build --functions-platform=${process.platform} --functions-arch=${process.arch}' or run 'gatsby build' with following envirnment variables: GATSBY_FUNCTIONS_PLATFORM=${process.platform} GATSBY_FUNCTIONS_ARCH=${process.arch}" thrown in gatsbyjs/gatsby.

Source

Thrown at packages/gatsby/src/schema/graphql-engine/platform-and-arch-check.ts:5

if (
  process.env.GATSBY_FUNCTIONS_PLATFORM !== process.platform ||
  process.env.GATSBY_FUNCTIONS_ARCH !== process.arch
) {
  throw new Error(
    `Incompatible DSG/SSR executing environment. Function was built for "${process.env.GATSBY_FUNCTIONS_PLATFORM}/${process.env.GATSBY_FUNCTIONS_ARCH}" but is executing on "${process.platform}/${process.arch}".` +
      (process.env.gatsby_executing_command === `serve`
        ? `\n\nIf you are trying to run DSG/SSR engine locally, consider using experimental utility to rebuild functions for your local platform:\n\nnode node_modules/gatsby/dist/schema/graphql-engine/standalone-regenerate.js`
        : ``) +
      `\n\nTo generate engines for "${process.platform}/${process.arch}" run 'gatsby build --functions-platform=${process.platform} --functions-arch=${process.arch}' or run 'gatsby build' with following envirnment variables:\n\nGATSBY_FUNCTIONS_PLATFORM=${process.platform}\nGATSBY_FUNCTIONS_ARCH=${process.arch}`
  )
}

View on GitHub (pinned to e85d62f177)

Solutions

  1. Run 'gatsby build --functions-platform=<platform> --functions-arch=<arch>' matching the runtime
  2. Set GATSBY_FUNCTIONS_PLATFORM and GATSBY_FUNCTIONS_ARCH env vars to the executing platform
  3. Build on the same OS/architecture as the deploy target
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby/src/schema/graphql-engine/platform-and-arch-check.ts:5 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/3d5b9ffb5da7dcaa. Report an issue: GitHub.