File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/nextjs/src/client Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11import { WINDOW , rewriteFramesIntegration } from '@sentry/browser' ;
22import { defineIntegration } from '@sentry/core' ;
33
4- const windowOrigin = WINDOW . location . origin ;
5-
64export const nextjsClientStackFrameNormalizationIntegration = defineIntegration (
75 ( { assetPrefix, basePath } : { assetPrefix ?: string ; basePath ?: string } ) => {
6+ const windowOrigin = WINDOW . location . origin ;
7+
88 const rewriteFramesInstance = rewriteFramesIntegration ( {
99 // Turn `<origin>/<path>/_next/static/...` into `app:///_next/static/...`
1010 iteratee : frame => {
1111 if ( assetPrefix ) {
12- frame . filename = frame . filename ?. replace ( assetPrefix , 'app://' ) ;
12+ if ( frame . filename ?. startsWith ( assetPrefix ) ) {
13+ frame . filename = frame . filename . replace ( assetPrefix , 'app://' ) ;
14+ }
1315 } else if ( basePath ) {
1416 try {
1517 const { origin : frameOrigin } = new URL ( frame . filename as string ) ;
You can’t perform that action at this time.
0 commit comments