perf: Remove dynamic imports of Sentry (#20545)
This commit is contained in:
1 parent
ddde762f9b
commit
3d583678cf
6 files changed
+10
-11
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { wrapApiHandlerWithSentry } from "@sentry/nextjs";
|
||||
import { captureException } from "@sentry/nextjs";
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
|
||||
import { getServerErrorFromUnknown } from "./getServerErrorFromUnknown";
|
||||
@@ -28,7 +29,6 @@ export function defaultResponder<T>(
|
||||
// we don't want to report Bad Request errors to Sentry / console
|
||||
if (!(error.statusCode >= 400 && error.statusCode < 500)) {
|
||||
console.error(error);
|
||||
const captureException = (await import("@sentry/nextjs")).captureException;
|
||||
captureException(error);
|
||||
}
|
||||
return res
|
||||
|
||||
Reference in new issue
Block a user