Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
NODE_OPTIONS = "--max-old-space-size=4096"

[build]
command = "vite build"
command = "vite build && cp src/instrument.server.mjs dist/server"
publish = "dist/client"

[functions]
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dev": "pnpm run with-env vite dev",
"with-env": "dotenv -e ../../.env",
"dev:frontend": "pnpm run with-env vite dev",
"build": "vite build",
"build": "vite build && cp src/instrument.server.mjs dist/server",
"start": "vite start",
"lint": "eslint --ext .ts,.tsx ./src",
"format": "prettier --experimental-cli --ignore-unknown '**/*' --write",
Expand Down Expand Up @@ -37,8 +37,8 @@
"@radix-ui/react-toast": "^1.2.2",
"@react-three/drei": "^10.7.7",
"@react-three/fiber": "^9.5.0",
"@sentry/react": "^8.35.0",
"@sentry/vite-plugin": "^2.22.6",
"@sentry/tanstackstart-react": "^10.32.1",
"@sentry/vite-plugin": "^4.6.1",
"@tailwindcss/typography": "^0.5.13",
"@tailwindcss/vite": "^4.1.11",
"@tanstack/pacer": "^0.16.4",
Expand Down
893 changes: 726 additions & 167 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/components/DefaultCatchBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {
useMatch,
useRouter,
} from '@tanstack/react-router'
import * as Sentry from '@sentry/tanstackstart-react'

import { Button } from './Button'
import { useEffect } from 'react'

// type DefaultCatchBoundaryType = {
// status: number
Expand All @@ -17,6 +20,9 @@ import { Button } from './Button'

export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
const router = useRouter()
useEffect(() => {
Sentry.captureException(error)
}, [error])
const isRoot = useMatch({
strict: false,
select: (state) => state.id === rootRouteId,
Expand Down
11 changes: 11 additions & 0 deletions src/instrument.server.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as Sentry from '@sentry/tanstackstart-react'

Sentry.init({
dsn: 'https://ac4bfc43ff4a892f8dc7053c4a50d92f@o4507236158537728.ingest.us.sentry.io/4507236163649536',
integrations: [],
sendDefaultPii: true,
// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ['localhost', /^https:\/\/tanstack\.com\//],
})
19 changes: 19 additions & 0 deletions src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { DefaultCatchBoundary } from './components/DefaultCatchBoundary'
import { NotFound } from './components/NotFound'
import { QueryClient } from '@tanstack/react-query'
import { GamOnPageChange } from './components/Gam'
import * as Sentry from '@sentry/tanstackstart-react'

export function getRouter() {
const queryClient: QueryClient = new QueryClient({
Expand Down Expand Up @@ -42,6 +43,24 @@ export function getRouter() {
GamOnPageChange()
})

if (!router.isServer) {
Sentry.init({
dsn: 'https://ac4bfc43ff4a892f8dc7053c4a50d92f@o4507236158537728.ingest.us.sentry.io/4507236163649536',
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration(),
],
sendDefaultPii: true,
// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ['localhost', /^https:\/\/tanstack\.com\//],
// Session Replay
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
})
}

return router
}

Expand Down
16 changes: 0 additions & 16 deletions src/utils/sentry.ts

This file was deleted.

Loading