From daa2aa1da0c451a6c30385dfba538c4e9cd83348 Mon Sep 17 00:00:00 2001 From: Konsti Wohlwend Date: Sat, 23 Nov 2024 00:17:52 +0100 Subject: [PATCH] Sentry fixes (#347) --- apps/dashboard/next.config.mjs | 5 ++++- apps/dashboard/src/app/api/[...any]/route.tsx | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/next.config.mjs b/apps/dashboard/next.config.mjs index 50a163d33..a09cfdc83 100644 --- a/apps/dashboard/next.config.mjs +++ b/apps/dashboard/next.config.mjs @@ -1,8 +1,8 @@ import { withSentryConfig } from "@sentry/nextjs"; import rehypeKatex from "rehype-katex"; -import remarkMath from "remark-math"; import remarkGfm from "remark-gfm"; import remarkHeadingId from "remark-heading-id"; +import remarkMath from "remark-math"; import createMDX from "@next/mdx"; @@ -88,6 +88,9 @@ const nextConfig = { }, skipTrailingSlashRedirect: true, + experimental: { + instrumentationHook: true, + }, async headers() { return [ diff --git a/apps/dashboard/src/app/api/[...any]/route.tsx b/apps/dashboard/src/app/api/[...any]/route.tsx index 61a0313f4..8623a9f5a 100644 --- a/apps/dashboard/src/app/api/[...any]/route.tsx +++ b/apps/dashboard/src/app/api/[...any]/route.tsx @@ -4,7 +4,7 @@ import '../../../polyfills'; const handler = async (req: NextRequest) => { const msg = "Stack Auth's dashboard API is no longer available. Please upgrade the version of your Stack Auth client library, or join our Discord server for assistance: https://discord.stack-auth.com"; - console.log(`${req.headers.has('x-stack-project-id') ? `Project ${req.headers.get('x-stack-project-id')}` : "A user"} attempted to access the old dashboard API.`, nicify(req)); + console.warn(`${req.headers.has('x-stack-project-id') ? `Project ${req.headers.get('x-stack-project-id')}` : "A user"} attempted to access the old dashboard API.`, nicify(req)); return NextResponse.json({ error: msg, }, {