gatsbyjs/gatsby · error

111002

111002

Error message

${errorContext || ``}\n\n${e.message} \n\nReceived HTML as a response. Are you sure ${url} is the correct URL and WPGraphQL is active?

What it means

Error "${errorContext || ``}\n\n${e.message} \n\nReceived HTML as a response. Are you sure ${url} is the correct URL and WPGraphQL is active?" thrown in gatsbyjs/gatsby.

Source

Thrown at packages/gatsby-source-wordpress/src/utils/fetch-graphql.ts:557

      pluginOptions?.debug?.graphql?.copyHtmlResponseOnError

    if (copyHtmlResponseOnError) {
      try {
        // clipboardy is ESM-only package
        const { default: clipboardy } = await import(`clipboardy`)
        if (`writeSync` in clipboardy) {
          clipboardy.writeSync(response.data)
        }
      } catch (e) {
        reporter.error(
          formatLogMessage(
            `Unable to copy html response on error.\n\n${e.message ?? ``}`
          )
        )
      }
    }

    reporter.panic({
      id: CODES.BadResponse,
      context: {
        sourceMessage: formatLogMessage(
          `${errorContext || ``}\n\n${
            e.message
          } \n\nReceived HTML as a response. Are you sure ${url} is the correct URL and WPGraphQL is active?\n\nIf you're sure WPGraphQL is active, visit that URL in a browser - if it redirects to the correct URL,\nor you've entered the wrong URL in settings,\nyou might receive this error.\nVisit that URL in your browser and if it looks good copy/paste it from your URL bar to your gatsby-config.js.\n\n${ensureStatementsAreTrue}${
            copyHtmlResponseOnError
              ? `\n\nCopied HTML response to your clipboard.`
              : `\n\n${bold(
                  `Further debugging`
                )}\nIf you still receive this error after following the steps above, this may be a problem with your WordPress instance.\nA plugin or theme may be adding additional output for some posts or pages.\nAdd the following plugin option to copy the html response to your clipboard for debugging.\nYou can paste the response into an html file to see what's being returned.\n
{
  resolve: "gatsby-source-wordpress",
  options: {
    debug: {
      graphql: {
        copyHtmlResponseOnError: true
      }

View on GitHub (pinned to 8b06340921)

Solutions

  1. Verify the url option points to the WPGraphQL endpoint (usually https://yoursite.com/graphql), not the site root.
  2. Confirm WPGraphQL is installed and active on the WordPress site.
  3. Check for security plugins or server rules returning an HTML error page for the endpoint.

When it happens

Trigger: Thrown at packages/gatsby-source-wordpress/src/utils/fetch-graphql.ts:557 when the library encounters an invalid state.

Common situations: Occurs when the WPGraphQL endpoint returns HTML instead of JSON, meaning the URL is wrong or WPGraphQL is inactive. Verify the endpoint URL and that the WPGraphQL plugin is installed and active.


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