Skip to content

Commit 1e99e8d

Browse files
committed
2nd try fix of sentry to use maps instead of chunks
1 parent c69d77e commit 1e99e8d

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

astro.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import { createSerializeFunction, pagesJsonWriter } from './src/integrations/sit
4040
const devServerPort = Number(process.env['DEV_SERVER_PORT'] ?? 4321)
4141
const viteLogger = createLogger(undefined, { allowClearScreen: false })
4242
const sentryAuthToken = process.env['SENTRY_AUTH_TOKEN']
43-
const sentryRelease = getPackageRelease()
4443
const shouldEnableSentryIntegration = Boolean(sentryAuthToken)
4544

4645
const shouldSuppressViteWarning = (message: string): boolean => {
@@ -85,10 +84,13 @@ const standardIntegrations = [
8584
testimonialsLengthWarning({ min: 300, max: 400 }),
8685
/** Enable Sentry build integration when CI provides upload credentials. */
8786
...(shouldEnableSentryIntegration && sentryAuthToken ? [sentry({
87+
enabled: {
88+
client: false,
89+
server: true,
90+
},
8891
project: 'webstack-builders-corporate-website',
8992
org: 'webstack-builders',
9093
authToken: sentryAuthToken,
91-
release: sentryRelease,
9294
})] : []),
9395
sitemap({
9496
serialize: createSerializeFunction({

src/components/scripts/sentry/client.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import {
2-
BrowserClient,
32
breadcrumbsIntegration,
43
dedupeIntegration,
54
defaultStackParser,
65
feedbackIntegration,
7-
getCurrentScope,
86
globalHandlersIntegration,
97
httpClientIntegration,
8+
init,
109
makeFetchTransport,
1110
linkedErrorsIntegration,
1211
} from '@sentry/browser'
@@ -34,7 +33,7 @@ export class SentryBootstrap {
3433
static init(): void {
3534
// Check analytics consent for PII handling
3635
const hasAnalyticsConsent = getAnalyticsConsentPreference()
37-
const client = new BrowserClient({
36+
init({
3837
dsn: getSentryDsn(),
3938
integrations: [
4039
// Core integrations
@@ -103,9 +102,6 @@ export class SentryBootstrap {
103102
beforeSend: beforeSendHandler,
104103
})
105104

106-
getCurrentScope().setClient(client)
107-
client.init()
108-
109105
console.log('✅ Sentry monitoring initialized')
110106
}
111107
}

0 commit comments

Comments
 (0)