diff --git a/package-lock.json b/package-lock.json index eb782024f..08a4a3263 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,9 +18,7 @@ "@navikt/ds-tailwind": "^6.9.0", "@navikt/ds-tokens": "^6.9.0", "@reduxjs/toolkit": "^1.9.7", - "@sentry/integrations": "^7.114.0", - "@sentry/react": "^7.119.0", - "@sentry/tracing": "^7.114.0", + "@sentry/react": "^8.33.1", "@vitejs/plugin-react-swc": "^3.7.1", "classnames": "^2.5.1", "date-fns": "^3.0.0", @@ -1689,194 +1687,133 @@ "win32" ] }, - "node_modules/@sentry-internal/feedback": { - "version": "7.119.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-7.119.0.tgz", - "integrity": "sha512-om8TkAU5CQGO8nkmr7qsSBVkP+/vfeS4JgtW3sjoTK0fhj26+DljR6RlfCGWtYQdPSP6XV7atcPTjbSnsmG9FQ==", + "node_modules/@sentry-internal/browser-utils": { + "version": "8.33.1", + "resolved": "https://registry.npmjs.org/@sentry-internal/browser-utils/-/browser-utils-8.33.1.tgz", + "integrity": "sha512-TW6/r+Gl5jiXv54iK1xZ3mlVgTS/jaBp4vcQ0xGMdgiQ3WchEPcFSeYovL+YHT3tSud0GZqVtDQCz+5i76puqA==", + "license": "MIT", "dependencies": { - "@sentry/core": "7.119.0", - "@sentry/types": "7.119.0", - "@sentry/utils": "7.119.0" + "@sentry/core": "8.33.1", + "@sentry/types": "8.33.1", + "@sentry/utils": "8.33.1" }, "engines": { - "node": ">=12" + "node": ">=14.18" } }, - "node_modules/@sentry-internal/replay-canvas": { - "version": "7.119.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-7.119.0.tgz", - "integrity": "sha512-NL02VQx6ekPxtVRcsdp1bp5Tb5w6vnfBKSIfMKuDRBy5A10Uc3GSoy/c3mPyHjOxB84452A+xZSx6bliEzAnuA==", + "node_modules/@sentry-internal/feedback": { + "version": "8.33.1", + "resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-8.33.1.tgz", + "integrity": "sha512-qauMRTm3qDaLqZ3ibI03cj4gLF40y0ij65nj+cns6iWxGCtPrO8tjvXFWuQsE7Aye9dGMnBgmv7uN+NTUtC3RA==", + "license": "MIT", "dependencies": { - "@sentry/core": "7.119.0", - "@sentry/replay": "7.119.0", - "@sentry/types": "7.119.0", - "@sentry/utils": "7.119.0" + "@sentry/core": "8.33.1", + "@sentry/types": "8.33.1", + "@sentry/utils": "8.33.1" }, "engines": { - "node": ">=12" + "node": ">=14.18" } }, - "node_modules/@sentry-internal/tracing": { - "version": "7.119.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.119.0.tgz", - "integrity": "sha512-oKdFJnn+56f0DHUADlL8o9l8jTib3VDLbWQBVkjD9EprxfaCwt2m8L5ACRBdQ8hmpxCEo4I8/6traZ7qAdBUqA==", + "node_modules/@sentry-internal/replay": { + "version": "8.33.1", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay/-/replay-8.33.1.tgz", + "integrity": "sha512-fm4coIOjmanU29NOVN9MyaP4fUCOYytbtFqVSKRFNZQ/xAgNeySiBIbUd6IjujMmnOk9bY0WEUMcdm3Uotjdog==", + "license": "MIT", "dependencies": { - "@sentry/core": "7.119.0", - "@sentry/types": "7.119.0", - "@sentry/utils": "7.119.0" + "@sentry-internal/browser-utils": "8.33.1", + "@sentry/core": "8.33.1", + "@sentry/types": "8.33.1", + "@sentry/utils": "8.33.1" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/browser": { - "version": "7.119.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.119.0.tgz", - "integrity": "sha512-WwmW1Y4D764kVGeKmdsNvQESZiAn9t8LmCWO0ucBksrjL2zw9gBPtOpRcO6l064sCLeSxxzCN+kIxhRm1gDFEA==", + "node_modules/@sentry-internal/replay-canvas": { + "version": "8.33.1", + "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-8.33.1.tgz", + "integrity": "sha512-nsxTFTPCT10Ty/v6+AiST3+yotGP1sUb8xqfKB9fPnS1hZHFryp0NnEls7xFjBsBbZPU1GpFkzrk/E6JFzixDQ==", + "license": "MIT", "dependencies": { - "@sentry-internal/feedback": "7.119.0", - "@sentry-internal/replay-canvas": "7.119.0", - "@sentry-internal/tracing": "7.119.0", - "@sentry/core": "7.119.0", - "@sentry/integrations": "7.119.0", - "@sentry/replay": "7.119.0", - "@sentry/types": "7.119.0", - "@sentry/utils": "7.119.0" + "@sentry-internal/replay": "8.33.1", + "@sentry/core": "8.33.1", + "@sentry/types": "8.33.1", + "@sentry/utils": "8.33.1" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/core": { - "version": "7.119.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.119.0.tgz", - "integrity": "sha512-CS2kUv9rAJJEjiRat6wle3JATHypB0SyD7pt4cpX5y0dN5dZ1JrF57oLHRMnga9fxRivydHz7tMTuBhSSwhzjw==", + "node_modules/@sentry/browser": { + "version": "8.33.1", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-8.33.1.tgz", + "integrity": "sha512-c6zI/igexkLwZuGk+u8Rj26ChjxGgkhe6ZbKFsXCYaKAp5ep5X7HQRkkqgbxApiqlC0LduHdd/ymzh139JLg8w==", + "license": "MIT", "dependencies": { - "@sentry/types": "7.119.0", - "@sentry/utils": "7.119.0" + "@sentry-internal/browser-utils": "8.33.1", + "@sentry-internal/feedback": "8.33.1", + "@sentry-internal/replay": "8.33.1", + "@sentry-internal/replay-canvas": "8.33.1", + "@sentry/core": "8.33.1", + "@sentry/types": "8.33.1", + "@sentry/utils": "8.33.1" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, - "node_modules/@sentry/integrations": { - "version": "7.119.0", - "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.119.0.tgz", - "integrity": "sha512-OHShvtsRW0A+ZL/ZbMnMqDEtJddPasndjq+1aQXw40mN+zeP7At/V1yPZyFaURy86iX7Ucxw5BtmzuNy7hLyTA==", + "node_modules/@sentry/core": { + "version": "8.33.1", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-8.33.1.tgz", + "integrity": "sha512-3SS41suXLFzxL3OQvTMZ6q92ZapELVq2l2SoWlZopcamWhog2Ru0dp2vkunq97kFHb2TzKRTlFH4+4gbT8SJug==", + "license": "MIT", "dependencies": { - "@sentry/core": "7.119.0", - "@sentry/types": "7.119.0", - "@sentry/utils": "7.119.0", - "localforage": "^1.8.1" + "@sentry/types": "8.33.1", + "@sentry/utils": "8.33.1" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, "node_modules/@sentry/react": { - "version": "7.119.0", - "resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.119.0.tgz", - "integrity": "sha512-cf8Cei+qdSA26gx+IMAuc/k44PeBImNzIpXi3930SLhUe44ypT5OZ/44L6xTODHZzTIyMSJPduf59vT2+eW9yg==", - "dependencies": { - "@sentry/browser": "7.119.0", - "@sentry/core": "7.119.0", - "@sentry/types": "7.119.0", - "@sentry/utils": "7.119.0", + "version": "8.33.1", + "resolved": "https://registry.npmjs.org/@sentry/react/-/react-8.33.1.tgz", + "integrity": "sha512-SsEX05xfcfOvo7/pK1UyeyTAYWH8iSIsXXlsjvnSRsbuJkjb0c+q6yiZpj3A2PRdbcx43nTVE1n0lSpgaqj2HA==", + "license": "MIT", + "dependencies": { + "@sentry/browser": "8.33.1", + "@sentry/core": "8.33.1", + "@sentry/types": "8.33.1", + "@sentry/utils": "8.33.1", "hoist-non-react-statics": "^3.3.2" }, "engines": { - "node": ">=8" + "node": ">=14.18" }, "peerDependencies": { - "react": "15.x || 16.x || 17.x || 18.x" - } - }, - "node_modules/@sentry/replay": { - "version": "7.119.0", - "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.119.0.tgz", - "integrity": "sha512-BnNsYL+X5I4WCH6wOpY6HQtp4MgVt0NVlhLUsEyrvMUiTs0bPkDBrulsgZQBUKJsbOr3l9nHrFoNVB/0i6WNLA==", - "dependencies": { - "@sentry-internal/tracing": "7.119.0", - "@sentry/core": "7.119.0", - "@sentry/types": "7.119.0", - "@sentry/utils": "7.119.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@sentry/tracing": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.114.0.tgz", - "integrity": "sha512-eldEYGADReZ4jWdN5u35yxLUSTOvjsiZAYd4KBEpf+Ii65n7g/kYOKAjNl7tHbrEG1EsMW4nDPWStUMk1w+tfg==", - "dependencies": { - "@sentry-internal/tracing": "7.114.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/tracing/node_modules/@sentry-internal/tracing": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.114.0.tgz", - "integrity": "sha512-dOuvfJN7G+3YqLlUY4HIjyWHaRP8vbOgF+OsE5w2l7ZEn1rMAaUbPntAR8AF9GBA6j2zWNoSo8e7GjbJxVofSg==", - "dependencies": { - "@sentry/core": "7.114.0", - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/tracing/node_modules/@sentry/core": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.114.0.tgz", - "integrity": "sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA==", - "dependencies": { - "@sentry/types": "7.114.0", - "@sentry/utils": "7.114.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/tracing/node_modules/@sentry/types": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.114.0.tgz", - "integrity": "sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@sentry/tracing/node_modules/@sentry/utils": { - "version": "7.114.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.114.0.tgz", - "integrity": "sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg==", - "dependencies": { - "@sentry/types": "7.114.0" - }, - "engines": { - "node": ">=8" + "react": "^16.14.0 || 17.x || 18.x || 19.x" } }, "node_modules/@sentry/types": { - "version": "7.119.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.119.0.tgz", - "integrity": "sha512-27qQbutDBPKGbuJHROxhIWc1i0HJaGLA90tjMu11wt0E4UNxXRX+UQl4Twu68v4EV3CPvQcEpQfgsViYcXmq+w==", + "version": "8.33.1", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.33.1.tgz", + "integrity": "sha512-GjoAMvwtpIemoF/IiwZ7A60g4nQv3qwzR21GvJqDVUoKD0e8pv9OLX+HyXoUat4wEDGSuDUcUyUKD2G+od73QA==", + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=14.18" } }, "node_modules/@sentry/utils": { - "version": "7.119.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.119.0.tgz", - "integrity": "sha512-ZwyXexWn2ZIe2bBoYnXJVPc2esCSbKpdc6+0WJa8eutXfHq3FRKg4ohkfCBpfxljQGEfP1+kfin945lA21Ka+A==", + "version": "8.33.1", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-8.33.1.tgz", + "integrity": "sha512-uzuYpiiJuFY3N4WNHMBWUQX5oNv2t/TbG0OHRp3Rr7yeu+HSfD542TIp9/gMZ+G0Cxd8AmVO3wkKIFbk0TL4Qg==", + "license": "MIT", "dependencies": { - "@sentry/types": "7.119.0" + "@sentry/types": "8.33.1" }, "engines": { - "node": ">=8" + "node": ">=14.18" } }, "node_modules/@sinclair/typebox": { @@ -6865,11 +6802,6 @@ "node": ">=0.10.0" } }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" - }, "node_modules/immer": { "version": "9.0.21", "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz", @@ -7936,14 +7868,6 @@ "source-map": "~0.6.0" } }, - "node_modules/lie": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", - "integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==", - "dependencies": { - "immediate": "~3.0.5" - } - }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -8098,14 +8022,6 @@ "url": "https://github.com/sponsors/antfu" } }, - "node_modules/localforage": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz", - "integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==", - "dependencies": { - "lie": "3.1.1" - } - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", diff --git a/package.json b/package.json index d94575419..f4b4d3af3 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,7 @@ "@navikt/ds-tailwind": "^6.9.0", "@navikt/ds-tokens": "^6.9.0", "@reduxjs/toolkit": "^1.9.7", - "@sentry/integrations": "^7.114.0", - "@sentry/react": "^7.119.0", - "@sentry/tracing": "^7.114.0", + "@sentry/react": "^8.33.1", "@vitejs/plugin-react-swc": "^3.7.1", "classnames": "^2.5.1", "date-fns": "^3.0.0", diff --git a/src/sentry.ts b/src/sentry.ts index 0715ca684..6dc538f62 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -1,6 +1,13 @@ -import { captureConsoleIntegration } from '@sentry/integrations'; -import * as Sentry from '@sentry/react'; -import { Breadcrumb, Event } from '@sentry/types'; +import { + captureConsoleIntegration, + reactRouterV6BrowserTracingIntegration, + ErrorEvent, + init, + httpClientIntegration, + wrapCreateBrowserRouter, + EventHint, + Breadcrumb, +} from '@sentry/react'; import React from 'react'; import { createRoutesFromChildren, @@ -33,7 +40,7 @@ const tagsFilter = (tags: Event['tags']): Event['tags'] => { }; }; -const fjernPersonopplysninger = (event: Event): Event => { +const fjernPersonopplysninger = (event: ErrorEvent, hint: EventHint): ErrorEvent => { const url = event.request?.url ? maskerPersonopplysninger(event.request.url) : ''; return { ...event, @@ -58,17 +65,17 @@ const fjernPersonopplysninger = (event: Event): Event => { }; }; -Sentry.init({ +init({ dsn: 'https://1ab82c2af7614a74b134e36b3bd2e0b4@sentry.gc.nav.no/163', integrations: [ - Sentry.reactRouterV6BrowserTracingIntegration({ + reactRouterV6BrowserTracingIntegration({ useEffect: React.useEffect, useLocation, useNavigationType, createRoutesFromChildren, matchRoutes, }), - Sentry.httpClientIntegration({ + httpClientIntegration({ failedRequestTargets: [ /https:\/\/aktivitetsplan(\.ekstern\.dev)?\.nav\.no\/(veilarbaktivitet|veilarbdialog|veilarboppfolging|veilarblest|veilarbperson|veilarbmalverk|veilarbveileder)\/*/, ], @@ -101,4 +108,4 @@ Sentry.init({ ], }); -export const sentryCreateBrowserRouter = Sentry.wrapCreateBrowserRouter(createBrowserRouter); +export const sentryCreateBrowserRouter = wrapCreateBrowserRouter(createBrowserRouter);