mirror of
https://github.com/danbulant/Mangades
synced 2026-06-18 22:01:10 +00:00
attempt to fix
This commit is contained in:
parent
888480623c
commit
cfa7e7c572
1 changed files with 8 additions and 42 deletions
|
|
@ -1,58 +1,24 @@
|
|||
import { Toucan } from "toucan-js";
|
||||
import * as Sentry from '@sentry/browser';
|
||||
import { BrowserTracing } from "@sentry/tracing";
|
||||
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
export function load({ url, event }) {
|
||||
let sentry;
|
||||
// @ts-ignore
|
||||
if(import.meta.env.VITE_SENTRY_DSN && typeof event !== "undefined") if(typeof window === 'undefined') {
|
||||
sentry = new Toucan({
|
||||
if(import.meta.env.VITE_SENTRY_DSN && typeof event !== "undefined" && typeof window !== 'undefined')
|
||||
Sentry.init({
|
||||
// @ts-ignore
|
||||
dsn: import.meta.env.VITE_SENTRY_DSN,
|
||||
|
||||
dsn: import.meta.env.VITE_SENTRY_DSN,
|
||||
// @ts-ignore
|
||||
environment: import.meta.env.VITE_SENTRY_ENVIRONMENT,
|
||||
// @ts-ignore
|
||||
release: import.meta.env.VITE_SENTRY_RELEASE,
|
||||
request: event.request,
|
||||
requestDataOptions: {
|
||||
allowedHeaders: [
|
||||
'user-agent',
|
||||
'cf-challenge',
|
||||
'accept-encoding',
|
||||
'accept-language',
|
||||
'cf-ray',
|
||||
'content-length',
|
||||
'content-type',
|
||||
'x-real-ip',
|
||||
'host',
|
||||
'cf-ipcountry'
|
||||
],
|
||||
allowedSearchParams: /(.*)/
|
||||
}
|
||||
integrations: [
|
||||
new BrowserTracing(),
|
||||
],
|
||||
tracesSampleRate: 1
|
||||
});
|
||||
} else {
|
||||
sentry = Sentry;
|
||||
if(!sentry.isInitalized) {
|
||||
Sentry.init({
|
||||
// @ts-ignore
|
||||
dsn: import.meta.env.VITE_SENTRY_DSN,
|
||||
// @ts-ignore
|
||||
environment: import.meta.env.VITE_SENTRY_ENVIRONMENT,
|
||||
// @ts-ignore
|
||||
release: import.meta.env.VITE_SENTRY_RELEASE,
|
||||
integrations: [
|
||||
new BrowserTracing(),
|
||||
],
|
||||
tracesSampleRate: 1
|
||||
});
|
||||
|
||||
sentry.isInitalized = true;
|
||||
}
|
||||
}
|
||||
return {
|
||||
url: url.pathname,
|
||||
sentry
|
||||
url: url.pathname
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue