File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
packages/nextjs/src/config/templates Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 11
11
import * as wrapee from '__SENTRY_WRAPPING_TARGET_FILE__' ;
12
12
// eslint-disable-next-line import/no-extraneous-dependencies
13
13
import * as Sentry from '@sentry/nextjs' ;
14
- // @ts -ignore TODO
14
+ // @ts -ignore This template is only used with the app directory so we know that this dependency exists.
15
15
// eslint-disable-next-line import/no-unresolved
16
16
import { headers } from 'next/headers' ;
17
17
18
+ declare function headers ( ) : { get : ( header : string ) => string | undefined } ;
19
+
18
20
type ServerComponentModule = {
19
21
default : unknown ;
20
22
} ;
@@ -32,13 +34,8 @@ if (typeof serverComponent === 'function') {
32
34
let baggageHeader : string | undefined = undefined ;
33
35
34
36
if ( process . env . NEXT_PHASE !== 'phase-production-build' ) {
35
- // @ts -ignore TODO
36
- // eslint-disable-next-line import/no-unresolved
37
- // const { headers } = await import('next/headers');
38
37
const headersList = headers ( ) ;
39
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
40
38
sentryTraceHeader = headersList . get ( 'sentry-trace' ) ;
41
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
42
39
baggageHeader = headersList . get ( 'baggage' ) ;
43
40
}
44
41
You can’t perform that action at this time.
0 commit comments