{"record":{"id":"5dc0175248862c22","repo":"vercel/next.js","slug":"warning-err-message","errorCode":null,"errorMessage":"Warning: ${err.message}","messagePattern":"Warning: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/pages/_document.tsx","lineNumber":307,"sourceCode":"          }\n\n          return (\n            <script\n              {...srcProps}\n              {...scriptProps}\n              type=\"text/partytown\"\n              key={src || index}\n              nonce={props.nonce}\n              data-nscript=\"worker\"\n              crossOrigin={props.crossOrigin || crossOrigin}\n            />\n          )\n        })}\n      </>\n    )\n  } catch (err) {\n    if (isError(err) && err.code !== 'MODULE_NOT_FOUND') {\n      console.warn(`Warning: ${err.message}`)\n    }\n    return null\n  }\n}\n\nfunction getPreNextScripts(context: HtmlProps, props: OriginProps) {\n  const { scriptLoader, disableOptimizedLoading, crossOrigin } = context\n\n  const webWorkerScripts = getPreNextWorkerScripts(context, props)\n\n  const beforeInteractiveScripts = (scriptLoader.beforeInteractive || [])\n    .filter((script) => script.src)\n    .map((file: ScriptProps, index: number) => {\n      const { strategy, ...scriptProps } = file\n      return (\n        <script\n          {...scriptProps}\n          key={scriptProps.src || index}","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/pages/_document.tsx#L289-L325","documentation":"getPreNextWorkerScripts renders Partytown worker scripts inside a try/catch; when rendering fails with an error whose code is not MODULE_NOT_FOUND (i.e. something other than the partytown package simply missing), it logs the error message as a warning and returns null so the document still renders.","triggerScenarios":"Thrown at packages/next/src/pages/_document.tsx:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the warning source in your custom Document code and address the reported error."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}