Files
klz-cables.com/.pnpm-store/v10/files/21/12c57d39253ecf07589784d27d2afef9bbf5bbde7407a0f50e954da93f1a4e48096597d8c7c7d5e2ea2fa14a3ca569ebbabc93cdb9a967015abcdf8971c161
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

1 line
4.8 KiB
Plaintext

{"version":3,"file":"wrapAppGetInitialPropsWithSentry.js","sources":["../../../../src/common/pages-router-instrumentation/wrapAppGetInitialPropsWithSentry.ts"],"sourcesContent":["import type App from 'next/app';\nimport { isBuild } from '../utils/isBuild';\nimport { withErrorInstrumentation, withTracedServerSideDataFetcher } from '../utils/wrapperUtils';\n\ntype AppGetInitialProps = (typeof App)['getInitialProps'];\n\n/**\n * Create a wrapped version of the user's exported `getInitialProps` function in\n * a custom app (\"_app.js\").\n *\n * @param origAppGetInitialProps The user's `getInitialProps` function\n * @param parameterizedRoute The page's parameterized route\n * @returns A wrapped version of the function\n */\nexport function wrapAppGetInitialPropsWithSentry(origAppGetInitialProps: AppGetInitialProps): AppGetInitialProps {\n return new Proxy(origAppGetInitialProps, {\n apply: async (wrappingTarget, thisArg, args: Parameters<AppGetInitialProps>) => {\n if (isBuild()) {\n return wrappingTarget.apply(thisArg, args);\n }\n\n const [context] = args;\n const { req, res } = context.ctx;\n\n const errorWrappedAppGetInitialProps = withErrorInstrumentation(wrappingTarget);\n\n // Generally we can assume that `req` and `res` are always defined on the server:\n // https://nextjs.org/docs/api-reference/data-fetching/get-initial-props#context-object\n // This does not seem to be the case in dev mode. Because we have no clean way of associating the the data fetcher\n // span with each other when there are no req or res objects, we simply do not trace them at all here.\n if (req && res) {\n const tracedGetInitialProps = withTracedServerSideDataFetcher(errorWrappedAppGetInitialProps, req, res, {\n dataFetcherRouteName: '/_app',\n requestedRouteName: context.ctx.pathname,\n dataFetchingMethodName: 'getInitialProps',\n });\n\n const {\n data: appGetInitialProps,\n sentryTrace,\n baggage,\n }: {\n data?: unknown;\n sentryTrace?: string;\n baggage?: string;\n } = await tracedGetInitialProps.apply(thisArg, args);\n\n if (typeof appGetInitialProps === 'object' && appGetInitialProps !== null) {\n // Per definition, `pageProps` is not optional, however an increased amount of users doesn't seem to call\n // `App.getInitialProps(appContext)` in their custom `_app` pages which is required as per\n // https://nextjs.org/docs/advanced-features/custom-app - resulting in missing `pageProps`.\n // For this reason, we just handle the case where `pageProps` doesn't exist explicitly.\n if (!(appGetInitialProps as Record<string, unknown>).pageProps) {\n (appGetInitialProps as Record<string, unknown>).pageProps = {};\n }\n\n // The Next.js serializer throws on undefined values so we need to guard for it (#12102)\n if (sentryTrace) {\n (appGetInitialProps as { pageProps: Record<string, unknown> }).pageProps._sentryTraceData = sentryTrace;\n }\n\n // The Next.js serializer throws on undefined values so we need to guard for it (#12102)\n if (baggage) {\n (appGetInitialProps as { pageProps: Record<string, unknown> }).pageProps._sentryBaggage = baggage;\n }\n }\n\n return appGetInitialProps;\n } else {\n return errorWrappedAppGetInitialProps.apply(thisArg, args);\n }\n },\n });\n}\n"],"names":[],"mappings":";;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gCAAgC,CAAC,sBAAsB,EAA0C;AACjH,EAAE,OAAO,IAAI,KAAK,CAAC,sBAAsB,EAAE;AAC3C,IAAI,KAAK,EAAE,OAAO,cAAc,EAAE,OAAO,EAAE,IAAI,KAAqC;AACpF,MAAM,IAAI,OAAO,EAAE,EAAE;AACrB,QAAQ,OAAO,cAAc,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AAClD,MAAM;;AAEN,MAAM,MAAM,CA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