fix sentry

This commit is contained in:
Dreamgineer
2025-12-17 21:22:40 +07:00 Unverified
parent f4c2a870bd
commit 1e656fe091
8 changed files with 49 additions and 8 deletions
+3
View File
@@ -50,3 +50,6 @@ node_modules/
# Sentry Config File # Sentry Config File
.env.sentry-build-plugin .env.sentry-build-plugin
# Sentry Config File
.sentryclirc
+3 -3
View File
@@ -1,3 +1,3 @@
export async function CharacterCreatePage() { export default async function CharacterCreatePage() {
return return <div>wip</div>;
} }
+9 -1
View File
@@ -2,9 +2,16 @@ import { AnimatePresence } from "framer-motion";
import { Toaster } from "sonner"; import { Toaster } from "sonner";
import Background from "#/bg.jpg"; import Background from "#/bg.jpg";
import Image from "@/components/image"; import Image from "@/components/image";
import { SentryDevToolbar } from "@/components/sentry";
import { adminCheck } from "@/lib/auth";
import Providers, { VersionCheck } from "../client"; import Providers, { VersionCheck } from "../client";
export default function UiLayout({ children }: { children: React.ReactNode }) { export default async function UiLayout({
children,
}: {
children: React.ReactNode;
}) {
const isAdmin = await adminCheck();
return ( return (
<> <>
<Image <Image
@@ -15,6 +22,7 @@ export default function UiLayout({ children }: { children: React.ReactNode }) {
<Providers> <Providers>
<AnimatePresence mode="wait">{children}</AnimatePresence> <AnimatePresence mode="wait">{children}</AnimatePresence>
<VersionCheck /> <VersionCheck />
{isAdmin && <SentryDevToolbar />}
</Providers> </Providers>
<Toaster theme="dark" richColors closeButton /> <Toaster theme="dark" richColors closeButton />
</> </>
+4
View File
@@ -38,7 +38,9 @@
"@radix-ui/react-toggle": "^1.1.10", "@radix-ui/react-toggle": "^1.1.10",
"@radix-ui/react-toggle-group": "^1.1.11", "@radix-ui/react-toggle-group": "^1.1.11",
"@radix-ui/react-tooltip": "^1.2.8", "@radix-ui/react-tooltip": "^1.2.8",
"@sentry/cli": "^2",
"@sentry/nextjs": "^10", "@sentry/nextjs": "^10",
"@sentry/toolbar": "^1.0.0-beta.11",
"@tanstack/react-table": "^8.21.3", "@tanstack/react-table": "^8.21.3",
"@types/bun": "^1.3.4", "@types/bun": "^1.3.4",
"auto-text-size": "^0.2.3", "auto-text-size": "^0.2.3",
@@ -690,6 +692,8 @@
"@sentry/react": ["@sentry/[email protected]", "", { "dependencies": { "@sentry/browser": "10.31.0", "@sentry/core": "10.31.0", "hoist-non-react-statics": "^3.3.2" }, "peerDependencies": { "react": "^16.14.0 || 17.x || 18.x || 19.x" } }, "sha512-1Y+K/s64f/UBH4guU0F5T+b9nWT2AoRd1nlQShGlGBT2WEihIcnnftSb3Wdl9/zLO2kzbXjc63G0D4dx6sUY/w=="], "@sentry/react": ["@sentry/[email protected]", "", { "dependencies": { "@sentry/browser": "10.31.0", "@sentry/core": "10.31.0", "hoist-non-react-statics": "^3.3.2" }, "peerDependencies": { "react": "^16.14.0 || 17.x || 18.x || 19.x" } }, "sha512-1Y+K/s64f/UBH4guU0F5T+b9nWT2AoRd1nlQShGlGBT2WEihIcnnftSb3Wdl9/zLO2kzbXjc63G0D4dx6sUY/w=="],
"@sentry/toolbar": ["@sentry/[email protected]", "", { "peerDependencies": { "react": ">=18" } }, "sha512-7xImSt+R2v/rkWQfvjQEi7EBC/UfogmAVnGfb2iTs9IjvGlF1iQn/aRQZhU64Ve09aswRiFfUUJIbLIG05yG7A=="],
"@sentry/vercel-edge": ["@sentry/[email protected]", "", { "dependencies": { "@opentelemetry/api": "^1.9.0", "@opentelemetry/resources": "^2.2.0", "@sentry/core": "10.31.0" } }, "sha512-08cr/X4HsjDcfIUPtABS/MxzU79VUixAcBBikisWrzmh/10JSh/Efzs7+eAO7Il1EsdBg40bFV7RdhQjmrrnsA=="], "@sentry/vercel-edge": ["@sentry/[email protected]", "", { "dependencies": { "@opentelemetry/api": "^1.9.0", "@opentelemetry/resources": "^2.2.0", "@sentry/core": "10.31.0" } }, "sha512-08cr/X4HsjDcfIUPtABS/MxzU79VUixAcBBikisWrzmh/10JSh/Efzs7+eAO7Il1EsdBg40bFV7RdhQjmrrnsA=="],
"@sentry/webpack-plugin": ["@sentry/[email protected]", "", { "dependencies": { "@sentry/bundler-plugin-core": "4.6.1", "unplugin": "1.0.1", "uuid": "^9.0.0" }, "peerDependencies": { "webpack": ">=4.40.0" } }, "sha512-CJgT/t2pQWsPsMx9VJ86goU/orCQhL2HhDj5ZYBol6fPPoEGeTqKOPCnv/xsbCAfGSp1uHpyRLTA/Gx96u7VVA=="], "@sentry/webpack-plugin": ["@sentry/[email protected]", "", { "dependencies": { "@sentry/bundler-plugin-core": "4.6.1", "unplugin": "1.0.1", "uuid": "^9.0.0" }, "peerDependencies": { "webpack": ">=4.40.0" } }, "sha512-CJgT/t2pQWsPsMx9VJ86goU/orCQhL2HhDj5ZYBol6fPPoEGeTqKOPCnv/xsbCAfGSp1uHpyRLTA/Gx96u7VVA=="],
+22
View File
@@ -0,0 +1,22 @@
"use client";
import { useSentryToolbar } from "@sentry/toolbar";
import { comms } from "@/lib/comms";
export function SentryDevToolbar() {
const [debug] = comms.var("debug");
useSentryToolbar({
// Remember to conditionally enable the Toolbar.
// This will reduce network traffic for users
// who do not have credentials to login to Sentry.
enabled: debug === true,
initProps: {
organizationSlug: "astrxldev",
projectIdOrSlug: "buzz",
theme: "dark",
},
});
return "";
}
+2 -2
View File
@@ -31,9 +31,9 @@ export default withSentryConfig(nextConfig, {
// For all available options, see: // For all available options, see:
// https://www.npmjs.com/package/@sentry/webpack-plugin#options // https://www.npmjs.com/package/@sentry/webpack-plugin#options
org: "astral-development", org: "astrxldev",
project: "javascript-nextjs", project: "buzz",
// Only print logs for uploading source maps in CI // Only print logs for uploading source maps in CI
silent: !process.env.CI, silent: !process.env.CI,
+5 -2
View File
@@ -4,7 +4,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "bun --bun next dev --turbopack", "dev": "bun --bun next dev --turbopack",
"build": "bun --bun next build --turbopack", "build": "bun --bun next build --turbopack && bun run sentry:sourcemaps",
"analyze": "ANALYZE=true next build --webpack", "analyze": "ANALYZE=true next build --webpack",
"start": "bun --bun next start", "start": "bun --bun next start",
"lint": "biome check --fix", "lint": "biome check --fix",
@@ -14,7 +14,8 @@
"up": "docker compose build && docker rollout app && docker compose up -d backup && bun ngreload", "up": "docker compose build && docker rollout app && docker compose up -d backup && bun ngreload",
"logs": "docker compose logs -fn50", "logs": "docker compose logs -fn50",
"ngreload": "docker compose restart -t 0 nginx", "ngreload": "docker compose restart -t 0 nginx",
"test": "playwright test" "test": "playwright test",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org astrxldev --project buzz ./.next/server && sentry-cli sourcemaps upload --org astrxldev --project buzz ./.next/server"
}, },
"dependencies": { "dependencies": {
"@bprogress/next": "^3.2.12", "@bprogress/next": "^3.2.12",
@@ -50,7 +51,9 @@
"@radix-ui/react-toggle": "^1.1.10", "@radix-ui/react-toggle": "^1.1.10",
"@radix-ui/react-toggle-group": "^1.1.11", "@radix-ui/react-toggle-group": "^1.1.11",
"@radix-ui/react-tooltip": "^1.2.8", "@radix-ui/react-tooltip": "^1.2.8",
"@sentry/cli": "^2",
"@sentry/nextjs": "^10", "@sentry/nextjs": "^10",
"@sentry/toolbar": "^1.0.0-beta.11",
"@tanstack/react-table": "^8.21.3", "@tanstack/react-table": "^8.21.3",
"@types/bun": "^1.3.4", "@types/bun": "^1.3.4",
"auto-text-size": "^0.2.3", "auto-text-size": "^0.2.3",
+1
View File
@@ -0,0 +1 @@
@@||browser.sentry-cdn.com^$script