mirror of
https://github.com/danbulant/Mangades
synced 2026-07-05 11:00:40 +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 * as Sentry from '@sentry/browser';
|
||||||
import { BrowserTracing } from "@sentry/tracing";
|
import { BrowserTracing } from "@sentry/tracing";
|
||||||
|
|
||||||
/** @type {import('./$types').PageLoad} */
|
/** @type {import('./$types').PageLoad} */
|
||||||
export function load({ url, event }) {
|
export function load({ url, event }) {
|
||||||
let sentry;
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if(import.meta.env.VITE_SENTRY_DSN && typeof event !== "undefined") if(typeof window === 'undefined') {
|
if(import.meta.env.VITE_SENTRY_DSN && typeof event !== "undefined" && typeof window !== 'undefined')
|
||||||
sentry = new Toucan({
|
Sentry.init({
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
dsn: import.meta.env.VITE_SENTRY_DSN,
|
dsn: import.meta.env.VITE_SENTRY_DSN,
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
environment: import.meta.env.VITE_SENTRY_ENVIRONMENT,
|
environment: import.meta.env.VITE_SENTRY_ENVIRONMENT,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
release: import.meta.env.VITE_SENTRY_RELEASE,
|
release: import.meta.env.VITE_SENTRY_RELEASE,
|
||||||
request: event.request,
|
integrations: [
|
||||||
requestDataOptions: {
|
new BrowserTracing(),
|
||||||
allowedHeaders: [
|
],
|
||||||
'user-agent',
|
tracesSampleRate: 1
|
||||||
'cf-challenge',
|
|
||||||
'accept-encoding',
|
|
||||||
'accept-language',
|
|
||||||
'cf-ray',
|
|
||||||
'content-length',
|
|
||||||
'content-type',
|
|
||||||
'x-real-ip',
|
|
||||||
'host',
|
|
||||||
'cf-ipcountry'
|
|
||||||
],
|
|
||||||
allowedSearchParams: /(.*)/
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} 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 {
|
return {
|
||||||
url: url.pathname,
|
url: url.pathname
|
||||||
sentry
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue