gatsbyjs/gatsby · error

unknownApiError

unknownApiError

Error message

Received error ${e.response.status} from Shopify: ${await e.response.text()}

What it means

HttpError branch of the Shopify sourcing error handling: the fetch to the Shopify Admin API returned a non-OK HTTP status. The panic embeds the status code and the raw response body text, so the Shopify error payload (rate limit, throttling, auth) is visible in the build log.

Solutions

  1. Check the Shopify status code: 401/403 means invalid API credentials or missing access scopes; 429 means rate limiting - retry later.
  2. Verify the shop name and access token in plugin options, and that the private app has the required read scopes.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/gatsby-source-shopify/src/source-from-operation.ts:140 when the library encounters an invalid state.

Common situations: Occurs when the Shopify Admin API returns a non-2xx response (e.g. 401/403 bad credentials, 429 rate limit). Verify the access token, scopes, and shop domain, and retry after rate limiting subsides.


AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13). Data as JSON: /api/errors/18e5d9d449cb7e2a. Report an issue: GitHub.

Appendix: source

Thrown at packages/gatsby-source-shopify/src/source-from-operation.ts:140

            },
            error: e,
          })
        }

        reporter.panic({
          id: errorCodes.unknownSourcingFailure,
          context: {
            sourceMessage: shiftLeft`
              Operation ${op.name} failed after ${e.node.objectCount} objects
              - With status: ${e.node.status} - error code: ${e.node.errorCode}
            `,
          },
          error: e,
        })
      }

      if (e instanceof HttpError) {
        reporter.panic({
          id: errorCodes.unknownApiError,
          context: {
            sourceMessage: `Received error ${
              e.response.status
            } from Shopify: ${await e.response.text()}`,
          },
          error: e,
        })
      }

      console.log(e)

      reporter.panic({
        id: errorCodes.unknownSourcingFailure,
        context: {
          sourceMessage: `Could not source from bulk operation`,
        },
        error: e as Error,

View on GitHub (pinned to 8b06340921)