{"record":{"id":"e6de5c5595d43c95","repo":"gatsbyjs/gatsby","slug":"support-for-custom-promise-polyfills-has-been-remo","errorCode":null,"errorMessage":"Support for custom Promise polyfills has been removed in Gatsby v2. We only support Babel 7's new automatic polyfilling behavior.","messagePattern":"Support for custom Promise polyfills has been removed in Gatsby v2\\. We only support Babel 7's new automatic polyfilling behavior\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/services/initialize.ts","lineNumber":215,"sourceCode":"  })\n  activity.start()\n  const flattenedPlugins = await loadPlugins(config, siteDirectory)\n  activity.end()\n\n  // GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR=false gatsby develop\n  // to disable query on demand loading indicator\n  if (!process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR) {\n    // if GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR was not set at all\n    // enable loading indicator\n    process.env.GATSBY_QUERY_ON_DEMAND_LOADING_INDICATOR = `true`\n  }\n\n  if (process.env.GATSBY_DETECT_NODE_MUTATIONS) {\n    enableNodeMutationsDetection()\n  }\n\n  if (config && config.polyfill) {\n    reporter.warn(\n      `Support for custom Promise polyfills has been removed in Gatsby v2. We only support Babel 7's new automatic polyfilling behavior.`\n    )\n  }\n\n  // Throughout the codebase GATSBY_QUERY_ON_DEMAND is used to conditionally enable the QoD behavior, depending on if \"gatsby develop\" is running or not. In CI QoD is disabled by default, too.\n  // You can use GATSBY_ENABLE_QUERY_ON_DEMAND_IN_CI to force enable it in CI.\n  process.env.GATSBY_QUERY_ON_DEMAND = `true`\n  if (process.env.gatsby_executing_command !== `develop`) {\n    // we don't want to ever have this flag enabled for anything than develop\n    // in case someone have this env var globally set\n    delete process.env.GATSBY_QUERY_ON_DEMAND\n  } else if (isCI() && !process.env.GATSBY_ENABLE_QUERY_ON_DEMAND_IN_CI) {\n    delete process.env.GATSBY_QUERY_ON_DEMAND\n    reporter.verbose(\n      `Query on Demand is disabled in CI by default. You can enable it by setting GATSBY_ENABLE_QUERY_ON_DEMAND_IN_CI env var.`\n    )\n  }\n","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/services/initialize.ts#L197-L233","documentation":"Guard in initialize: the site config still sets the legacy `polyfill` option requesting a custom Promise polyfill, which stopped being supported in Gatsby v2 when Babel 7's automatic polyfilling became the only path. The config flag is now meaningless and triggers this warning.","triggerScenarios":"Thrown at packages/gatsby/src/services/initialize.ts:215 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the `polyfill: true` option from gatsby-config.js","Rely on Babel 7's automatic polyfilling instead of a custom Promise polyfill","If legacy browser support is needed, add polyfills via core-js in your own code"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}