{"record":{"id":"f3673d5061684892","repo":"gatsbyjs/gatsby","slug":"there-was-an-attempt-to-call-a-preview-onpagecreat","errorCode":null,"errorMessage":"There was an attempt to call a Preview onPageCreated callback for node ${nodeIdThatCreatedThisPage}, but no node was found.","messagePattern":"There was an attempt to call a Preview onPageCreated callback for node (.+?), but no node was found\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-source-wordpress/src/steps/preview/on-create-page.ts","lineNumber":91,"sourceCode":"  const nodePageCreatedCallback =\n    nodeIdThatCreatedThisPage &&\n    nodePageCreatedCallbacks[nodeIdThatCreatedThisPage]\n\n  if (\n    !nodeIdThatCreatedThisPage ||\n    typeof nodePageCreatedCallback !== `function`\n  ) {\n    return\n  }\n\n  getStore().dispatch.previewStore.unSubscribeToPagesCreatedFromNodeById({\n    nodeId: nodeIdThatCreatedThisPage,\n  })\n\n  const nodeThatCreatedThisPage = getNode(nodeIdThatCreatedThisPage)\n\n  if (!nodeThatCreatedThisPage) {\n    helpers.reporter.warn(\n      formatLogMessage(\n        `There was an attempt to call a Preview onPageCreated callback for node ${nodeIdThatCreatedThisPage}, but no node was found.`\n      )\n    )\n    return\n  }\n\n  // We need to add the modified time to pageContext so we can read it in WP\n  // This way can tell when the updated page has been deployed\n  if (!page.context.__wpGatsbyNodeModified) {\n    const pageCopy = { ...page }\n    pageCopy.context.__wpGatsbyNodeModified = nodeThatCreatedThisPage.modified\n\n    const { deletePage, createPage } = helpers.actions\n\n    deletePage(page)\n    createPage(pageCopy)\n  }","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-source-wordpress/src/steps/preview/on-create-page.ts#L73-L109","documentation":"In onCreatePageRespondToPreviewStatusQuery, a page was created whose context references a nodeIdThatCreatedThisPage with a registered preview onPageCreated callback, but getNode() can no longer find that node. This happens when the node was deleted or not yet created at page-creation time during a preview; the callback is skipped, so the WP editor may not receive a successful preview status for that node.","triggerScenarios":"Thrown at packages/gatsby-source-wordpress/src/steps/preview/on-create-page.ts:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run/retry the preview so the node exists when the page is created.","Ensure the previewed content still exists in WordPress and was not deleted mid-preview.","Run gatsby clean && gatsby develop to rebuild node/page state from scratch.","If reproducible, report to gatsby-source-wordpress — it may indicate a node/page creation ordering bug."],"exampleFix":null,"handlingStrategy":"type-guard","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-14T05:17:10.506Z"}