Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions packages/remix/src/utils/serverAdapters/express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { getCurrentHub } from '@sentry/hub';
import { flush } from '@sentry/node';
import { hasTracingEnabled } from '@sentry/tracing';
import { Transaction } from '@sentry/types';
import { extractRequestData, isString, loadModule, logger } from '@sentry/utils';
import { extractRequestData, isString, logger } from '@sentry/utils';
import { cwd } from 'process';

import {
createRoutes,
Expand All @@ -18,7 +19,6 @@ import {
ExpressRequest,
ExpressRequestHandler,
ExpressResponse,
ReactRouterDomPkg,
ServerBuild,
} from '../types';

Expand All @@ -27,7 +27,8 @@ function wrapExpressRequestHandler(
build: ServerBuild,
): ExpressRequestHandler {
const routes = createRoutes(build.routes);
const pkg = loadModule<ReactRouterDomPkg>('react-router-dom');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const pkg = require(`${cwd()}/node_modules/react-router-dom`);

// If the core request handler is already wrapped, don't wrap Express handler which uses it.
if (isRequestHandlerWrapped) {
Expand Down