From 86b05bb3db9232cf56469a15f32e240e362d54b7 Mon Sep 17 00:00:00 2001 From: Austin Poor <45295232+a-poor@users.noreply.github.com> Date: Sat, 4 Jan 2025 13:08:26 -0800 Subject: [PATCH] Removes error log and re-adds sourcemap upload --- .github/workflows/deploy.yml | 1 + app/entry.client.tsx | 16 +--------------- vite.config.ts | 12 ++++++++++++ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1d60185..60fcc5c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,3 +25,4 @@ jobs: env: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_KEY }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} diff --git a/app/entry.client.tsx b/app/entry.client.tsx index 8719511..608efe2 100644 --- a/app/entry.client.tsx +++ b/app/entry.client.tsx @@ -23,20 +23,6 @@ startTransition(() => { document, - , - { - onCaughtError: (error, errorInfo) => { - console.error('Caught error:', error, errorInfo); - Sentry.captureException(error); - }, - onUncaughtError: (error, errorInfo) => { - console.error('Uncaught error:', error, errorInfo); - Sentry.captureException(error); - }, - onRecoverableError: (error, errorInfo) => { - console.error('Recoverable error:', error, errorInfo); - Sentry.captureException(error); - }, - }, + ); }); diff --git a/vite.config.ts b/vite.config.ts index 61e6d89..c201b05 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -9,6 +9,7 @@ import tsconfigPaths from "vite-tsconfig-paths"; import yaml from 'js-yaml'; import Markdoc from '@markdoc/markdoc'; import readingTime from 'reading-time'; +import { sentryVitePlugin } from "@sentry/vite-plugin"; function importBlogPostPlugin() { const virtualModuleId = 'virtual:load-blog-posts'; @@ -65,6 +66,7 @@ function importBlogPostPlugin() { export default defineConfig(({ isSsrBuild }) => ({ build: { + sourcemap: true, rollupOptions: isSsrBuild ? { input: "./workers/app.ts", @@ -104,5 +106,15 @@ export default defineConfig(({ isSsrBuild }) => ({ importBlogPostPlugin(), reactRouter(), tsconfigPaths(), + + // Keep this at the end + sentryVitePlugin({ + authToken: process.env.SENTRY_AUTH_TOKEN, + org: "austinpoorcom", + project: "austinpoor-dot-com", + sourcemaps: { + filesToDeleteAfterUpload: "**/*.js.map", + }, + }), ], }));