File tree Expand file tree Collapse file tree 6 files changed +372
-122
lines changed
Expand file tree Collapse file tree 6 files changed +372
-122
lines changed Original file line number Diff line number Diff line change @@ -9,3 +9,6 @@ node_modules
99vite.config.js.timestamp- *
1010vite.config.ts.timestamp- *
1111.vercel
12+
13+ # Sentry Config File
14+ .sentryclirc
Original file line number Diff line number Diff line change 5656 "@cloudinary/html" : " ^1.11.2" ,
5757 "@cloudinary/url-gen" : " ^1.11.2" ,
5858 "@floating-ui/dom" : " ^1.5.3" ,
59+ "@sentry/sveltekit" : " ^7.78.0" ,
5960 "@steeze-ui/material-design-icons" : " ^1.1.2" ,
6061 "esm-env" : " ^1.0.0" ,
6162 "firebase" : " ^10.4.0" ,
Original file line number Diff line number Diff line change 1+ import { handleErrorWithSentry , Replay } from '@sentry/sveltekit' ;
2+ import * as Sentry from '@sentry/sveltekit' ;
3+ import { env } from '$env/dynamic/private' ;
4+
5+ Sentry . init ( {
6+ dsn : 'https://518fe25472568a2e47252e6f29583c6b@o1029244.ingest.sentry.io/4506190917206016' ,
7+ tracesSampleRate : 1.0 ,
8+
9+ // This sets the sample rate to be 10%. You may want this to be 100% while
10+ // in development and sample at a lower rate in production
11+ replaysSessionSampleRate : 0.1 ,
12+
13+ // If the entire session is not sampled, use the below sample rate to sample
14+ // sessions when an error occurs.
15+ replaysOnErrorSampleRate : 1.0 ,
16+
17+ // If you don't want to use Session Replay, just remove the line below:
18+ integrations : [ new Replay ( ) ] ,
19+ environment : env . VERCEL_ENV || 'local'
20+ } ) ;
21+
22+ // If you have a custom error handler, pass it to `handleErrorWithSentry`
23+ export const handleError = handleErrorWithSentry ( ) ;
Original file line number Diff line number Diff line change 1+ import { sequence } from '@sveltejs/kit/hooks' ;
2+ import * as Sentry from '@sentry/sveltekit' ;
13import { redirect , type Handle } from '@sveltejs/kit' ;
4+ import { env } from '$env/dynamic/private' ;
25
3- export const handle = ( async ( { event, resolve } ) => {
4- if ( event . url . pathname . startsWith ( '/tutorials' ) ) {
5- throw redirect ( 301 , '/posts' ) ;
6- }
6+ Sentry . init ( {
7+ dsn : 'https://518fe25472568a2e47252e6f29583c6b@o1029244.ingest.sentry.io/4506190917206016' ,
8+ tracesSampleRate : 1 ,
9+ environment : env . VERCEL_ENV || 'local'
10+ } ) ;
711
8- if ( event . url . pathname . startsWith ( '/tutorial' ) ) {
9- throw redirect ( 301 , `/post/${ event . url . pathname . split ( '/' ) . at ( - 1 ) } ` ) ;
10- }
12+ export const handle = sequence ( Sentry . sentryHandle ( ) , ( async ( { event, resolve } ) => {
13+ if ( event . url . pathname . startsWith ( '/tutorials' ) ) {
14+ throw redirect ( 301 , '/posts' ) ;
15+ }
1116
12- const response = await resolve ( event ) ;
13- return response ;
14- } ) satisfies Handle ;
17+ if ( event . url . pathname . startsWith ( '/tutorial' ) ) {
18+ throw redirect ( 301 , `/post/${ event . url . pathname . split ( '/' ) . at ( - 1 ) } ` ) ;
19+ }
20+
21+ const response = await resolve ( event ) ;
22+ return response ;
23+ } ) satisfies Handle ) ;
24+ export const handleError = Sentry . handleErrorWithSentry ( ) ;
Original file line number Diff line number Diff line change 1+ import { sentrySvelteKit } from "@sentry/sveltekit" ;
12import { sveltekit } from '@sveltejs/kit/vite' ;
23
34/** @type {import('vite').UserConfig } */
45const config = {
5- plugins : [ sveltekit ( ) ] ,
6- test : {
6+ plugins : [ sentrySvelteKit ( {
7+ sourceMapsUploadOptions : {
8+ org : "codingcatdev" ,
9+ project : "codingcatdev-main"
10+ }
11+ } ) , sveltekit ( ) ] ,
12+
13+ test : {
714 include : [ 'src/**/*.{test,spec}.{js,ts}' ]
815 } ,
9- ssr : {
16+
17+ ssr : {
1018 noExternal : [ 'gsap' , '@gsap/shockingly' , '@cloudinary/html' ]
1119 }
1220} ;
1321
14- export default config ;
22+ export default config ;
You can’t perform that action at this time.
0 commit comments