{"record":{"id":"77c15f69b25b0089","repo":"facebook/docusaurus","slug":"processing-of-page-source-file-path-relativesour","errorCode":null,"errorMessage":"Processing of page source file path=${relativeSource} failed.","messagePattern":"Processing of page source file path=(.+?) failed\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/docusaurus-plugin-content-pages/src/content.ts","lineNumber":81,"sourceCode":"  options: PluginOptions;\n  contentPaths: ContentPaths;\n};\n\nexport async function loadPagesContent(\n  params: LoadContentParams,\n): Promise<LoadedContent> {\n  const {options} = params;\n\n  const pagesFiles = await Globby(params.options.include, {\n    cwd: params.contentPaths.contentPath,\n    ignore: options.exclude,\n  });\n\n  async function doProcessPageSourceFile(relativeSource: string) {\n    try {\n      return await processPageSourceFile(relativeSource, params);\n    } catch (err) {\n      throw new Error(\n        `Processing of page source file path=${relativeSource} failed.`,\n        {cause: err},\n      );\n    }\n  }\n\n  return (await Promise.all(pagesFiles.map(doProcessPageSourceFile))).filter(\n    (res): res is Metadata => {\n      return res !== undefined;\n    },\n  );\n}\n\nasync function processPageSourceFile(\n  relativeSource: string,\n  params: LoadContentParams,\n): Promise<Metadata | undefined> {\n  const {context, options, contentPaths} = params;","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-plugin-content-pages/src/content.ts#L63-L99","documentation":"Thrown by loadPagesContent in the pages plugin as a wrapper around any failure while processing an individual page source file (processPageSourceFile). The original error is attached via Error options.cause. It surfaces during content loading (build/dev) and names the relative source path that failed, so the underlying cause must be inspected.","triggerScenarios":"Any unhandled exception from reading/parsing a page: invalid MDX, bad front matter, missing imported component, file read error, bad editUrl function, or a syntax error in a .md/.mdx/.jsx page file.","commonSituations":"Broken MDX in a page; front matter that fails validatePageFrontMatter; an import in an MDX page that resolves to nothing; permission/ENONENT on the source file; a custom remark/rehype plugin throwing.","solutions":["Look at err.cause (the wrapped error) for the real failure and fix that page.","Open the relative path named in the message and check MDX syntax, front matter, and imports.","Run `docusaurus start` / build again after fixing; if cause is unclear, reproduce by processing just that file."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await loadPagesContent(params);\n} catch (err) {\n  const cause = (err as Error & {cause?: Error}).cause;\n  console.error('Page failed:', err.message, '\\nRoot cause:', cause?.message);\n  // fix the offending page source, then rebuild\n}","preventionTips":["Lint MDX/front matter before build (remark/rehype).","Keep page imports resolvable; run typecheck on .mdx where possible.","Treat any wrapped 'cause' error as the source of truth, not the wrapper message."],"tags":["pages","mdx","build","cause-wrapped"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}