Skip to content

Commit

Permalink
Removes error log and re-adds sourcemap upload
Browse files Browse the repository at this point in the history
  • Loading branch information
a-poor committed Jan 4, 2025
1 parent 75e3c85 commit 86b05bb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
16 changes: 1 addition & 15 deletions app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@ startTransition(() => {
document,
<StrictMode>
<HydratedRouter />
</StrictMode>,
{
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);
},
},
</StrictMode>
);
});
12 changes: 12 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -65,6 +66,7 @@ function importBlogPostPlugin() {

export default defineConfig(({ isSsrBuild }) => ({
build: {
sourcemap: true,
rollupOptions: isSsrBuild
? {
input: "./workers/app.ts",
Expand Down Expand Up @@ -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",
},
}),
],
}));

0 comments on commit 86b05bb

Please sign in to comment.