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 1
1
import { WINDOW , rewriteFramesIntegration } from '@sentry/browser' ;
2
2
import { defineIntegration } from '@sentry/core' ;
3
3
4
- const windowOrigin = WINDOW . location . origin ;
5
-
6
4
export const nextjsClientStackFrameNormalizationIntegration = defineIntegration (
7
5
( { assetPrefix, basePath } : { assetPrefix ?: string ; basePath ?: string } ) => {
6
+ const windowOrigin = WINDOW . location . origin ;
7
+
8
8
const rewriteFramesInstance = rewriteFramesIntegration ( {
9
9
// Turn `<origin>/<path>/_next/static/...` into `app:///_next/static/...`
10
10
iteratee : frame => {
11
11
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
+ }
13
15
} else if ( basePath ) {
14
16
try {
15
17
const { origin : frameOrigin } = new URL ( frame . filename as string ) ;
You can’t perform that action at this time.
0 commit comments