File tree 1 file changed +3
-4
lines changed
packages/remix/src/utils/serverAdapters 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';
2
2
import { flush } from '@sentry/node' ;
3
3
import { hasTracingEnabled } from '@sentry/tracing' ;
4
4
import { 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' ;
7
6
8
7
import {
9
8
createRoutes ,
@@ -19,6 +18,7 @@ import {
19
18
ExpressRequest ,
20
19
ExpressRequestHandler ,
21
20
ExpressResponse ,
21
+ ReactRouterDomPkg ,
22
22
ServerBuild ,
23
23
} from '../types' ;
24
24
@@ -27,8 +27,7 @@ function wrapExpressRequestHandler(
27
27
build : ServerBuild ,
28
28
) : ExpressRequestHandler {
29
29
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' ) ;
32
31
33
32
// If the core request handler is already wrapped, don't wrap Express handler which uses it.
34
33
if ( isRequestHandlerWrapped ) {
You can’t perform that action at this time.
0 commit comments