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 1111import * as wrapee from '__SENTRY_WRAPPING_TARGET_FILE__' ;
1212// eslint-disable-next-line import/no-extraneous-dependencies
1313import * 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.
1515// eslint-disable-next-line import/no-unresolved
1616import { headers } from 'next/headers' ;
1717
18+ declare function headers ( ) : { get : ( header : string ) => string | undefined } ;
19+
1820type ServerComponentModule = {
1921 default : unknown ;
2022} ;
@@ -32,13 +34,8 @@ if (typeof serverComponent === 'function') {
3234 let baggageHeader : string | undefined = undefined ;
3335
3436 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');
3837 const headersList = headers ( ) ;
39- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
4038 sentryTraceHeader = headersList . get ( 'sentry-trace' ) ;
41- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
4239 baggageHeader = headersList . get ( 'baggage' ) ;
4340 }
4441
You can’t perform that action at this time.
0 commit comments