diff --git a/packages/features/flags/features.repository.ts b/packages/features/flags/features.repository.ts index 8fc6b96126..d7ff5419a2 100644 --- a/packages/features/flags/features.repository.ts +++ b/packages/features/flags/features.repository.ts @@ -1,5 +1,3 @@ -import { captureException } from "@sentry/nextjs"; - import db from "@calcom/prisma"; import type { AppFlags } from "./config"; @@ -11,6 +9,7 @@ export class FeaturesRepository implements IFeaturesRepository { try { return await getFeatureFlag(db, slug); } catch (err) { + const captureException = (await import("@sentry/nextjs")).captureException; captureException(err); throw err; } @@ -35,6 +34,7 @@ export class FeaturesRepository implements IFeaturesRepository { if (userBelongsToTeamWithFeature) return true; return false; } catch (err) { + const captureException = (await import("@sentry/nextjs")).captureException; captureException(err); throw err; } @@ -61,6 +61,7 @@ export class FeaturesRepository implements IFeaturesRepository { if (user) return true; return false; } catch (err) { + const captureException = (await import("@sentry/nextjs")).captureException; captureException(err); throw err; } @@ -72,6 +73,7 @@ export class FeaturesRepository implements IFeaturesRepository { }); return !!teamFeature; } catch (err) { + const captureException = (await import("@sentry/nextjs")).captureException; captureException(err); throw err; } diff --git a/packages/features/users/users.repository.ts b/packages/features/users/users.repository.ts index 279c4e55d6..cf5eedfd96 100644 --- a/packages/features/users/users.repository.ts +++ b/packages/features/users/users.repository.ts @@ -1,5 +1,3 @@ -import { captureException } from "@sentry/nextjs"; - import db from "@calcom/prisma"; import type { IUsersRepository } from "./users.repository.interface"; @@ -13,6 +11,7 @@ export class UsersRepository implements IUsersRepository { }); return user; } catch (err) { + const captureException = (await import("@sentry/nextjs")).captureException; captureException(err); throw err; } diff --git a/packages/features/watchlist/watchlist.repository.ts b/packages/features/watchlist/watchlist.repository.ts index 1c6f1355de..bb6e0cbb4f 100644 --- a/packages/features/watchlist/watchlist.repository.ts +++ b/packages/features/watchlist/watchlist.repository.ts @@ -1,5 +1,3 @@ -import { captureException } from "@sentry/nextjs"; - import db from "@calcom/prisma"; import { WatchlistType, WatchlistSeverity } from "@calcom/prisma/enums"; @@ -20,6 +18,7 @@ export class WatchlistRepository implements IWatchlistRepository { }); return emailInWatchlist; } catch (err) { + const captureException = (await import("@sentry/nextjs")).captureException; captureException(err); throw err; } @@ -35,6 +34,7 @@ export class WatchlistRepository implements IWatchlistRepository { }); return domainInWatchWatchlist; } catch (err) { + const captureException = (await import("@sentry/nextjs")).captureException; captureException(err); throw err; }