gatsbyjs/gatsby · error

sourcePreview was called but the required previewData proper

Error message

sourcePreview was called but the required previewData properties weren't provided.

What it means

In sourcePreview, the incoming preview webhook payload is checked against the required previewData properties (previewDatabaseId, id, token, remoteUrl, parentDatabaseId, modified, userDatabaseId). The warning fires when the payload is missing one or more of them (or is falsy), meaning the preview request is unusable; the missing keys are logged via reporter.info and the preview run is aborted.

Source

Thrown at packages/gatsby-source-wordpress/src/steps/preview/index.ts:252

    return
  }

  const requiredProperties = [
    `previewDatabaseId`,
    `id`,
    `token`,
    `remoteUrl`,
    `parentDatabaseId`,
    `modified`,
    `userDatabaseId`,
  ]

  const missingProperties = requiredProperties.filter(
    property => !(property in previewData)
  )

  if (!previewData || missingProperties.length) {
    reporter.warn(
      formatLogMessage(
        `sourcePreview was called but the required previewData properties weren't provided.`
      )
    )
    reporter.info(
      formatLogMessage(
        `Missing properties: \n${JSON.stringify(missingProperties, null, 2)}`
      )
    )
    reporter.log(
      formatLogMessage(`previewData: \n${JSON.stringify(previewData, null, 2)}`)
    )
    return
  }

  await touchValidNodes()

  const sendPreviewStatus = createPreviewStatusCallback({

View on GitHub (pinned to e85d62f177)

Solutions

  1. Inspect the logged 'Missing properties' list and fix the preview sender to include all required fields.
  2. Ensure the WPGatsby plugin in WordPress is up to date so it sends the full payload.
  3. Verify nothing (proxy/middleware) is stripping fields from the webhook body.
  4. Check that the preview request originates from the correct WordPress instance.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at packages/gatsby-source-wordpress/src/steps/preview/index.ts:252 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/1104a6719b176b3b. Report an issue: GitHub.