File tree Expand file tree Collapse file tree 1 file changed +12
-19
lines changed Expand file tree Collapse file tree 1 file changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -46,26 +46,19 @@ function sdkAlreadyInitialized(): boolean {
46
46
return ! ! hub . getClient ( ) ;
47
47
}
48
48
49
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
50
- // console.log((global as any).__rewriteFramesDistDir__);
51
- // debugger;
52
-
53
- // webpack will replace this placeholder at build time
54
-
55
- // FIXME
56
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
57
- const SOURCEMAP_FILENAME_REGEX = new RegExp ( escapeStringForRegex ( ( global as any ) . __rewriteFramesDistDir__ ) ) ;
58
-
59
- const defaultRewriteFramesIntegration = new RewriteFrames ( {
60
- iteratee : frame => {
61
- frame . filename = frame . filename ?. replace ( SOURCEMAP_FILENAME_REGEX , 'app:///_next/' ) ;
62
- return frame ;
63
- } ,
64
- } ) ;
65
-
66
- const defaultHttpTracingIntegration = new Integrations . Http ( { tracing : true } ) ;
67
-
68
49
function addServerIntegrations ( options : NextjsOptions ) : void {
50
+ // This value is injected at build time, based on the output directory specified in the build config
51
+ const buildDir = ( global as typeof global & { __rewriteFramesDistDir__ : string } ) . __rewriteFramesDistDir__ ;
52
+ const SOURCEMAP_FILENAME_REGEX = new RegExp ( escapeStringForRegex ( buildDir ) ) ;
53
+
54
+ const defaultRewriteFramesIntegration = new RewriteFrames ( {
55
+ iteratee : frame => {
56
+ frame . filename = frame . filename ?. replace ( SOURCEMAP_FILENAME_REGEX , 'app:///_next' ) ;
57
+ return frame ;
58
+ } ,
59
+ } ) ;
60
+ const defaultHttpTracingIntegration = new Integrations . Http ( { tracing : true } ) ;
61
+
69
62
if ( options . integrations ) {
70
63
options . integrations = addIntegration ( defaultRewriteFramesIntegration , options . integrations ) ;
71
64
} else {
You can’t perform that action at this time.
0 commit comments