File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/remix/src/utils/serverAdapters Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import { getCurrentHub } from '@sentry/hub';
22import { flush } from '@sentry/node' ;
33import { hasTracingEnabled } from '@sentry/tracing' ;
44import { Transaction } from '@sentry/types' ;
5- import { extractRequestData , isString , logger } from '@sentry/utils' ;
6- import { cwd } from 'process' ;
5+ import { extractRequestData , isString , loadModule , logger } from '@sentry/utils' ;
76
87import {
98 createRoutes ,
@@ -19,6 +18,7 @@ import {
1918 ExpressRequest ,
2019 ExpressRequestHandler ,
2120 ExpressResponse ,
21+ ReactRouterDomPkg ,
2222 ServerBuild ,
2323} from '../types' ;
2424
@@ -27,8 +27,7 @@ function wrapExpressRequestHandler(
2727 build : ServerBuild ,
2828) : ExpressRequestHandler {
2929 const routes = createRoutes ( build . routes ) ;
30- // eslint-disable-next-line @typescript-eslint/no-var-requires
31- const pkg = require ( `${ cwd ( ) } /node_modules/react-router-dom` ) ;
30+ const pkg = loadModule < ReactRouterDomPkg > ( 'react-router-dom' ) ;
3231
3332 // If the core request handler is already wrapped, don't wrap Express handler which uses it.
3433 if ( isRequestHandlerWrapped ) {
You can’t perform that action at this time.
0 commit comments