Skip to content

Commit 7f39a8a

Browse files
committed
break up handlers module and fix imports
1 parent d48f6fd commit 7f39a8a

File tree

8 files changed

+387
-318
lines changed

8 files changed

+387
-318
lines changed

packages/nextjs/src/utils/instrumentServer.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
configureScope,
55
deepReadDirSync,
66
getCurrentHub,
7-
Handlers,
7+
parseRequest,
88
startTransaction,
99
} from '@sentry/node';
1010
import { extractTraceparentData, getActiveTransaction, hasTracingEnabled } from '@sentry/tracing';
@@ -22,8 +22,6 @@ import { default as createNextServer } from 'next';
2222
import * as querystring from 'querystring';
2323
import * as url from 'url';
2424

25-
const { parseRequest } = Handlers;
26-
2725
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2826
type PlainObject<T = any> = { [key: string]: T };
2927

packages/nextjs/src/utils/withSentry.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { captureException, flush, getCurrentHub, Handlers, startTransaction } from '@sentry/node';
1+
import { captureException, flush, getCurrentHub, parseRequest, startTransaction } from '@sentry/node';
22
import { extractTraceparentData, hasTracingEnabled } from '@sentry/tracing';
33
import { Transaction } from '@sentry/types';
44
import {
@@ -12,8 +12,6 @@ import {
1212
import * as domain from 'domain';
1313
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
1414

15-
const { parseRequest } = Handlers;
16-
1715
// This is the same as the `NextApiHandler` type, except instead of having a return type of `void | Promise<void>`, it's
1816
// only `Promise<void>`, because wrapped handlers are always async
1917
export type WrappedNextApiHandler = (req: NextApiRequest, res: NextApiResponse) => Promise<void>;

0 commit comments

Comments
 (0)