From cf3a96cead26e8b74291dd404eea18c794c9d8a1 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sun, 1 Mar 2026 13:05:06 +0100 Subject: [PATCH] fix(web): add missing sentry instrumentation dependencies for standalone build --- apps/web/instrumentation.ts | 13 +++++++++++++ apps/web/next.config.mjs | 4 +++- apps/web/package.json | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 apps/web/instrumentation.ts diff --git a/apps/web/instrumentation.ts b/apps/web/instrumentation.ts new file mode 100644 index 0000000..7cbe93c --- /dev/null +++ b/apps/web/instrumentation.ts @@ -0,0 +1,13 @@ +import * as Sentry from "@sentry/nextjs"; + +export async function register() { + if (process.env.NEXT_RUNTIME === "nodejs") { + await import("./sentry.server.config"); + } + + if (process.env.NEXT_RUNTIME === "edge") { + await import("./sentry.edge.config"); + } +} + +export const onRequestError = Sentry.captureRequestError; diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index e00a359..fcfdc73 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -16,7 +16,9 @@ const nextConfig = { '@mintel/pdf', 'canvas', 'sharp', - 'puppeteer' // Explicitly externalizing heavy node-native dependencies + 'puppeteer', + 'require-in-the-middle', + 'import-in-the-middle' // Sentry 10+ instrumentation dependencies ], images: { remotePatterns: [ diff --git a/apps/web/package.json b/apps/web/package.json index 86e597a..edc4c0f 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -75,6 +75,7 @@ "framer-motion": "^12.29.2", "graphql": "^16.12.0", "html-to-image": "^1.11.13", + "import-in-the-middle": "^1.11.0", "ioredis": "^5.9.1", "lucide-react": "^0.468.0", "mermaid": "^11.12.2", @@ -92,6 +93,7 @@ "react-tweet": "^3.3.0", "recharts": "^3.7.0", "remotion": "^4.0.414", + "require-in-the-middle": "^8.0.1", "sharp": "^0.34.5", "shiki": "^1.24.2", "tailwind-merge": "^3.4.0",