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
1 line
6.2 KiB
Plaintext
1 line
6.2 KiB
Plaintext
{"version":3,"file":"clientNormalizationIntegration.js","sources":["../../../src/client/clientNormalizationIntegration.ts"],"sourcesContent":["import { defineIntegration } from '@sentry/core';\nimport { rewriteFramesIntegration } from '@sentry/react';\n\nexport const nextjsClientStackFrameNormalizationIntegration = defineIntegration(\n ({\n assetPrefix,\n basePath,\n rewriteFramesAssetPrefixPath,\n experimentalThirdPartyOriginStackFrames,\n }: {\n assetPrefix?: string;\n basePath?: string;\n rewriteFramesAssetPrefixPath: string;\n experimentalThirdPartyOriginStackFrames: boolean;\n }) => {\n const rewriteFramesInstance = rewriteFramesIntegration({\n // Turn `<origin>/<path>/_next/static/...` into `app:///_next/static/...`\n iteratee: frame => {\n if (experimentalThirdPartyOriginStackFrames) {\n // Not sure why but access to global WINDOW from @sentry/Browser causes hideous ci errors\n // eslint-disable-next-line no-restricted-globals\n const windowOrigin = typeof window !== 'undefined' && window.location ? window.location.origin : '';\n // A filename starting with the local origin and not ending with JS is most likely JS in HTML which we do not want to rewrite\n if (frame.filename?.startsWith(windowOrigin) && !frame.filename.endsWith('.js')) {\n return frame;\n }\n\n if (assetPrefix) {\n // If the user defined an asset prefix, we need to strip it so that we can match it with uploaded sourcemaps.\n // assetPrefix always takes priority over basePath.\n if (frame.filename?.startsWith(assetPrefix)) {\n frame.filename = frame.filename.replace(assetPrefix, 'app://');\n }\n } else if (basePath) {\n // If the user defined a base path, we need to strip it to match with uploaded sourcemaps.\n // We should only do this for same-origin filenames though, so that third party assets are not rewritten.\n try {\n const { origin: frameOrigin } = new URL(frame.filename as string);\n if (frameOrigin === windowOrigin) {\n frame.filename = frame.filename?.replace(frameOrigin, 'app://').replace(basePath, '');\n }\n } catch {\n // Filename wasn't a properly formed URL, so there's nothing we can do\n }\n }\n } else {\n try {\n const { origin } = new URL(frame.filename as string);\n frame.filename = frame.filename?.replace(origin, 'app://').replace(rewriteFramesAssetPrefixPath, '');\n } catch {\n // Filename wasn't a properly formed URL, so there's nothing we can do\n }\n }\n\n // We need to URI-decode the filename because Next.js has wildcard routes like \"/users/[id].js\" which show up as \"/users/%5id%5.js\" in Error stacktraces.\n // The corresponding sources that Next.js generates have proper brackets so we also need proper brackets in the frame so that source map resolving works.\n if (experimentalThirdPartyOriginStackFrames) {\n if (frame.filename?.includes('/_next')) {\n frame.filename = decodeURI(frame.filename);\n }\n\n if (\n frame.filename?.match(\n /\\/_next\\/static\\/chunks\\/(main-|main-app-|polyfills-|webpack-|framework-|framework\\.)[0-9a-f]+\\.js$/,\n )\n ) {\n // We don't care about these frames. It's Next.js internal code.\n frame.in_app = false;\n }\n } else {\n if (frame.filename?.startsWith('app:///_next')) {\n frame.filename = decodeURI(frame.filename);\n }\n\n if (\n frame.filename?.match(\n /^app:\\/\\/\\/_next\\/static\\/chunks\\/(main-|main-app-|polyfills-|webpack-|framework-|framework\\.)[0-9a-f]+\\.js$/,\n )\n ) {\n // We don't care about these frames. It's Next.js internal code.\n frame.in_app = false;\n }\n }\n\n return frame;\n },\n });\n\n return {\n ...rewriteFramesInstance,\n name: 'NextjsClientStackFrameNormalization',\n };\n },\n);\n"],"names":[],"mappings":";;;AAGO,MAAM,8CAAA,GAAiD,iBAAiB;AAC/E,EAAE,CAAC;AACH,IAAI,WAAW;AACf,IAAI,QAAQ;AACZ,IAAI,4BAA4B;AAChC,IAAI,uCAAuC;AAC3C;;AAKE,KAAM;AACR,IAAI,MAAM,qBAAA,GAAwB,wBAAwB,CAAC;AAC3D;AACA,MAAM,QAAQ,EAAE,KAAA,IAAS;AACzB,QAAQ,IAAI,uCAAuC,EAA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