Skip to content

Commit ae747fa

Browse files
committed
instrumentation.tsでsentryをトップレベルimportしない
1 parent 7546d08 commit ae747fa

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

instrumentation.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as Sentry from "@sentry/nextjs";
21
export async function register() {
32
if (process.env.NEXT_RUNTIME === "nodejs") {
43
await import("./sentry.server.config");
@@ -8,4 +7,8 @@ export async function register() {
87
}
98
}
109
// Capture errors from Server Components, middleware, and proxies
11-
export const onRequestError = Sentry.captureRequestError;
10+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
11+
export async function onRequestError(e: unknown, r: any, ec: any) {
12+
const { captureRequestError } = await import("@sentry/nextjs");
13+
captureRequestError(e, r, ec);
14+
}

0 commit comments

Comments
 (0)