@sentry/nextjs
Advanced tools
Comparing version 8.25.0 to 8.26.0
@@ -60,9 +60,6 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const customDefaultIntegrations = react.getDefaultIntegrations(options); | ||
// This evaluates to true unless __SENTRY_TRACING__ is text-replaced with "false", in which case everything inside | ||
// will get treeshaken away | ||
// This evaluates to true unless __SENTRY_TRACING__ is text-replaced with "false", | ||
// in which case everything inside will get tree-shaken away | ||
if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) { | ||
if (core.hasTracingEnabled(options)) { | ||
customDefaultIntegrations.push(browserTracingIntegration.browserTracingIntegration()); | ||
} | ||
customDefaultIntegrations.push(browserTracingIntegration.browserTracingIntegration()); | ||
} | ||
@@ -69,0 +66,0 @@ |
@@ -26,3 +26,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
scope.setContext('nextjs', { | ||
request_path: request.url, | ||
request_path: request.path, | ||
router_kind: errorContext.routerKind, | ||
@@ -29,0 +29,0 @@ router_path: errorContext.routePath, |
@@ -72,3 +72,6 @@ var { | ||
) { | ||
return async function ( ...args) { | ||
return async function ( | ||
...args | ||
) { | ||
return tracingUtils.escapeNextjsTracing(() => { | ||
@@ -100,4 +103,9 @@ const isolationScope = tracingUtils.commonObjectToIsolationScope(req); | ||
dataFetcherSpan.setStatus({ code: core.SPAN_STATUS_OK }); | ||
const { 'sentry-trace': sentryTrace, baggage } = core.getTraceData(); | ||
try { | ||
return await origDataFetcher.apply(this, args); | ||
return { | ||
sentryTrace: sentryTrace, | ||
baggage: baggage, | ||
data: await origDataFetcher.apply(this, args), | ||
}; | ||
} catch (e) { | ||
@@ -104,0 +112,0 @@ dataFetcherSpan.setStatus({ code: core.SPAN_STATUS_ERROR, message: 'internal_error' }); |
@@ -1,9 +0,3 @@ | ||
var { | ||
_nullishCoalesce | ||
} = require('@sentry/utils'); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const core = require('@sentry/core'); | ||
const utils = require('@sentry/utils'); | ||
const isBuild = require('./utils/isBuild.js'); | ||
@@ -31,2 +25,3 @@ const wrapperUtils = require('./utils/wrapperUtils.js'); | ||
const errorWrappedAppGetInitialProps = wrapperUtils.withErrorInstrumentation(wrappingTarget); | ||
// Generally we can assume that `req` and `res` are always defined on the server: | ||
@@ -43,9 +38,10 @@ // https://nextjs.org/docs/api-reference/data-fetching/get-initial-props#context-object | ||
const appGetInitialProps | ||
const { | ||
data: appGetInitialProps, | ||
sentryTrace, | ||
baggage, | ||
} | ||
= await tracedGetInitialProps.apply(thisArg, args); | ||
const activeSpan = core.getActiveSpan(); | ||
const requestSpan = _nullishCoalesce(wrapperUtils.getSpanFromRequest(req), () => ( (activeSpan ? core.getRootSpan(activeSpan) : undefined))); | ||
// Per definition, `pageProps` is not optional, however an increased amount of users doesn't seem to call | ||
@@ -59,17 +55,10 @@ // `App.getInitialProps(appContext)` in their custom `_app` pages which is required as per | ||
if (requestSpan) { | ||
const sentryTrace = core.spanToTraceHeader(requestSpan); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
appGetInitialProps.pageProps._sentryTraceData = sentryTrace; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
appGetInitialProps.pageProps._sentryTraceData = sentryTrace; | ||
} | ||
const dynamicSamplingContext = core.getDynamicSamplingContextFromSpan(requestSpan); | ||
const baggage = utils.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
appGetInitialProps.pageProps._sentryBaggage = baggage; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
appGetInitialProps.pageProps._sentryBaggage = baggage; | ||
} | ||
@@ -76,0 +65,0 @@ |
@@ -18,3 +18,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
return new Proxy(origDocumentGetInitialProps, { | ||
apply: (wrappingTarget, thisArg, args) => { | ||
apply: async (wrappingTarget, thisArg, args) => { | ||
if (isBuild.isBuild()) { | ||
@@ -39,3 +39,4 @@ return wrappingTarget.apply(thisArg, args); | ||
return tracedGetInitialProps.apply(thisArg, args); | ||
const { data } = await tracedGetInitialProps.apply(thisArg, args); | ||
return data; | ||
} else { | ||
@@ -42,0 +43,0 @@ return errorWrappedGetInitialProps.apply(thisArg, args); |
@@ -1,9 +0,3 @@ | ||
var { | ||
_nullishCoalesce | ||
} = require('@sentry/utils'); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const core = require('@sentry/core'); | ||
const utils = require('@sentry/utils'); | ||
const isBuild = require('./utils/isBuild.js'); | ||
@@ -44,24 +38,18 @@ const wrapperUtils = require('./utils/wrapperUtils.js'); | ||
const errorGetInitialProps | ||
const { | ||
data: errorGetInitialProps, | ||
baggage, | ||
sentryTrace, | ||
} | ||
= await tracedGetInitialProps.apply(thisArg, args); | ||
const activeSpan = core.getActiveSpan(); | ||
const requestSpan = _nullishCoalesce(wrapperUtils.getSpanFromRequest(req), () => ( (activeSpan ? core.getRootSpan(activeSpan) : undefined))); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
errorGetInitialProps._sentryTraceData = sentryTrace; | ||
} | ||
if (requestSpan) { | ||
const sentryTrace = core.spanToTraceHeader(requestSpan); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
errorGetInitialProps._sentryTraceData = sentryTrace; | ||
} | ||
const dynamicSamplingContext = core.getDynamicSamplingContextFromSpan(requestSpan); | ||
const baggage = utils.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
errorGetInitialProps._sentryBaggage = baggage; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
errorGetInitialProps._sentryBaggage = baggage; | ||
} | ||
@@ -68,0 +56,0 @@ |
var { | ||
_nullishCoalesce, | ||
_asyncNullishCoalesce | ||
@@ -8,4 +7,2 @@ } = require('@sentry/utils'); | ||
const core = require('@sentry/core'); | ||
const utils = require('@sentry/utils'); | ||
const isBuild = require('./utils/isBuild.js'); | ||
@@ -43,24 +40,18 @@ const wrapperUtils = require('./utils/wrapperUtils.js'); | ||
const initialProps | ||
const { | ||
data: initialProps, | ||
baggage, | ||
sentryTrace, | ||
} | ||
= await _asyncNullishCoalesce((await tracedGetInitialProps.apply(thisArg, args)), async () => ( {})); // Next.js allows undefined to be returned from a getInitialPropsFunction. | ||
const activeSpan = core.getActiveSpan(); | ||
const requestSpan = _nullishCoalesce(wrapperUtils.getSpanFromRequest(req), () => ( (activeSpan ? core.getRootSpan(activeSpan) : undefined))); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
initialProps._sentryTraceData = sentryTrace; | ||
} | ||
if (requestSpan) { | ||
const sentryTrace = core.spanToTraceHeader(requestSpan); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
initialProps._sentryTraceData = sentryTrace; | ||
} | ||
const dynamicSamplingContext = core.getDynamicSamplingContextFromSpan(requestSpan); | ||
const baggage = utils.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
initialProps._sentryBaggage = baggage; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
initialProps._sentryBaggage = baggage; | ||
} | ||
@@ -67,0 +58,0 @@ |
@@ -1,9 +0,3 @@ | ||
var { | ||
_nullishCoalesce | ||
} = require('@sentry/utils'); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const core = require('@sentry/core'); | ||
const utils = require('@sentry/utils'); | ||
const isBuild = require('./utils/isBuild.js'); | ||
@@ -39,23 +33,17 @@ const wrapperUtils = require('./utils/wrapperUtils.js'); | ||
const serverSideProps = await (tracedGetServerSideProps.apply(thisArg, args) | ||
const { | ||
data: serverSideProps, | ||
baggage, | ||
sentryTrace, | ||
} = await (tracedGetServerSideProps.apply(thisArg, args) ); | ||
); | ||
if (serverSideProps && 'props' in serverSideProps) { | ||
const activeSpan = core.getActiveSpan(); | ||
const requestSpan = _nullishCoalesce(wrapperUtils.getSpanFromRequest(req), () => ( (activeSpan ? core.getRootSpan(activeSpan) : undefined))); | ||
if (requestSpan) { | ||
const sentryTrace = core.spanToTraceHeader(requestSpan); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
(serverSideProps.props )._sentryTraceData = sentryTrace; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
(serverSideProps.props )._sentryTraceData = sentryTrace; | ||
} | ||
const dynamicSamplingContext = core.getDynamicSamplingContextFromSpan(requestSpan); | ||
const baggage = utils.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
(serverSideProps.props )._sentryBaggage = baggage; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
(serverSideProps.props )._sentryBaggage = baggage; | ||
} | ||
@@ -62,0 +50,0 @@ } |
@@ -18,3 +18,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
return new Proxy(origGetStaticPropsa, { | ||
apply: (wrappingTarget, thisArg, args) => { | ||
apply: async (wrappingTarget, thisArg, args) => { | ||
if (isBuild.isBuild()) { | ||
@@ -21,0 +21,0 @@ return wrappingTarget.apply(thisArg, args); |
@@ -1,2 +0,2 @@ | ||
import { applySdkMetadata, addEventProcessor, hasTracingEnabled } from '@sentry/core'; | ||
import { applySdkMetadata, addEventProcessor } from '@sentry/core'; | ||
import { init as init$1, getDefaultIntegrations as getDefaultIntegrations$1 } from '@sentry/react'; | ||
@@ -59,9 +59,6 @@ export * from '@sentry/react'; | ||
const customDefaultIntegrations = getDefaultIntegrations$1(options); | ||
// This evaluates to true unless __SENTRY_TRACING__ is text-replaced with "false", in which case everything inside | ||
// will get treeshaken away | ||
// This evaluates to true unless __SENTRY_TRACING__ is text-replaced with "false", | ||
// in which case everything inside will get tree-shaken away | ||
if (typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) { | ||
if (hasTracingEnabled(options)) { | ||
customDefaultIntegrations.push(browserTracingIntegration()); | ||
} | ||
customDefaultIntegrations.push(browserTracingIntegration()); | ||
} | ||
@@ -68,0 +65,0 @@ |
@@ -24,3 +24,3 @@ import { withScope, captureException } from '@sentry/core'; | ||
scope.setContext('nextjs', { | ||
request_path: request.url, | ||
request_path: request.path, | ||
router_kind: errorContext.routerKind, | ||
@@ -27,0 +27,0 @@ router_path: errorContext.routePath, |
import { _optionalChain } from '@sentry/utils'; | ||
import { withIsolationScope, continueTrace, withActiveSpan, startSpanManual, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SPAN_STATUS_OK, SPAN_STATUS_ERROR, startInactiveSpan, startSpan, captureException } from '@sentry/core'; | ||
import { withIsolationScope, continueTrace, withActiveSpan, startSpanManual, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SPAN_STATUS_OK, getTraceData, SPAN_STATUS_ERROR, startInactiveSpan, startSpan, captureException } from '@sentry/core'; | ||
import { isString } from '@sentry/utils'; | ||
@@ -67,3 +67,6 @@ import { flushSafelyWithTimeout, autoEndSpanOnResponseEnd } from './responseEnd.js'; | ||
) { | ||
return async function ( ...args) { | ||
return async function ( | ||
...args | ||
) { | ||
return escapeNextjsTracing(() => { | ||
@@ -95,4 +98,9 @@ const isolationScope = commonObjectToIsolationScope(req); | ||
dataFetcherSpan.setStatus({ code: SPAN_STATUS_OK }); | ||
const { 'sentry-trace': sentryTrace, baggage } = getTraceData(); | ||
try { | ||
return await origDataFetcher.apply(this, args); | ||
return { | ||
sentryTrace: sentryTrace, | ||
baggage: baggage, | ||
data: await origDataFetcher.apply(this, args), | ||
}; | ||
} catch (e) { | ||
@@ -99,0 +107,0 @@ dataFetcherSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' }); |
@@ -1,6 +0,3 @@ | ||
import { _nullishCoalesce } from '@sentry/utils'; | ||
import { getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getRootSpan } from '@sentry/core'; | ||
import { dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils'; | ||
import { isBuild } from './utils/isBuild.js'; | ||
import { withTracedServerSideDataFetcher, getSpanFromRequest, withErrorInstrumentation } from './utils/wrapperUtils.js'; | ||
import { withTracedServerSideDataFetcher, withErrorInstrumentation } from './utils/wrapperUtils.js'; | ||
@@ -26,2 +23,3 @@ /** | ||
const errorWrappedAppGetInitialProps = withErrorInstrumentation(wrappingTarget); | ||
// Generally we can assume that `req` and `res` are always defined on the server: | ||
@@ -38,9 +36,10 @@ // https://nextjs.org/docs/api-reference/data-fetching/get-initial-props#context-object | ||
const appGetInitialProps | ||
const { | ||
data: appGetInitialProps, | ||
sentryTrace, | ||
baggage, | ||
} | ||
= await tracedGetInitialProps.apply(thisArg, args); | ||
const activeSpan = getActiveSpan(); | ||
const requestSpan = _nullishCoalesce(getSpanFromRequest(req), () => ( (activeSpan ? getRootSpan(activeSpan) : undefined))); | ||
// Per definition, `pageProps` is not optional, however an increased amount of users doesn't seem to call | ||
@@ -54,17 +53,10 @@ // `App.getInitialProps(appContext)` in their custom `_app` pages which is required as per | ||
if (requestSpan) { | ||
const sentryTrace = spanToTraceHeader(requestSpan); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
appGetInitialProps.pageProps._sentryTraceData = sentryTrace; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
appGetInitialProps.pageProps._sentryTraceData = sentryTrace; | ||
} | ||
const dynamicSamplingContext = getDynamicSamplingContextFromSpan(requestSpan); | ||
const baggage = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
appGetInitialProps.pageProps._sentryBaggage = baggage; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
appGetInitialProps.pageProps._sentryBaggage = baggage; | ||
} | ||
@@ -71,0 +63,0 @@ |
@@ -16,3 +16,3 @@ import { isBuild } from './utils/isBuild.js'; | ||
return new Proxy(origDocumentGetInitialProps, { | ||
apply: (wrappingTarget, thisArg, args) => { | ||
apply: async (wrappingTarget, thisArg, args) => { | ||
if (isBuild()) { | ||
@@ -37,3 +37,4 @@ return wrappingTarget.apply(thisArg, args); | ||
return tracedGetInitialProps.apply(thisArg, args); | ||
const { data } = await tracedGetInitialProps.apply(thisArg, args); | ||
return data; | ||
} else { | ||
@@ -40,0 +41,0 @@ return errorWrappedGetInitialProps.apply(thisArg, args); |
@@ -1,6 +0,3 @@ | ||
import { _nullishCoalesce } from '@sentry/utils'; | ||
import { getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getRootSpan } from '@sentry/core'; | ||
import { dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils'; | ||
import { isBuild } from './utils/isBuild.js'; | ||
import { withTracedServerSideDataFetcher, getSpanFromRequest, withErrorInstrumentation } from './utils/wrapperUtils.js'; | ||
import { withTracedServerSideDataFetcher, withErrorInstrumentation } from './utils/wrapperUtils.js'; | ||
@@ -39,24 +36,18 @@ /** | ||
const errorGetInitialProps | ||
const { | ||
data: errorGetInitialProps, | ||
baggage, | ||
sentryTrace, | ||
} | ||
= await tracedGetInitialProps.apply(thisArg, args); | ||
const activeSpan = getActiveSpan(); | ||
const requestSpan = _nullishCoalesce(getSpanFromRequest(req), () => ( (activeSpan ? getRootSpan(activeSpan) : undefined))); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
errorGetInitialProps._sentryTraceData = sentryTrace; | ||
} | ||
if (requestSpan) { | ||
const sentryTrace = spanToTraceHeader(requestSpan); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
errorGetInitialProps._sentryTraceData = sentryTrace; | ||
} | ||
const dynamicSamplingContext = getDynamicSamplingContextFromSpan(requestSpan); | ||
const baggage = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
errorGetInitialProps._sentryBaggage = baggage; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
errorGetInitialProps._sentryBaggage = baggage; | ||
} | ||
@@ -63,0 +54,0 @@ |
@@ -1,6 +0,4 @@ | ||
import { _nullishCoalesce, _asyncNullishCoalesce } from '@sentry/utils'; | ||
import { getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getRootSpan } from '@sentry/core'; | ||
import { dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils'; | ||
import { _asyncNullishCoalesce } from '@sentry/utils'; | ||
import { isBuild } from './utils/isBuild.js'; | ||
import { withTracedServerSideDataFetcher, getSpanFromRequest, withErrorInstrumentation } from './utils/wrapperUtils.js'; | ||
import { withTracedServerSideDataFetcher, withErrorInstrumentation } from './utils/wrapperUtils.js'; | ||
@@ -36,24 +34,18 @@ /** | ||
const initialProps | ||
const { | ||
data: initialProps, | ||
baggage, | ||
sentryTrace, | ||
} | ||
= await _asyncNullishCoalesce((await tracedGetInitialProps.apply(thisArg, args)), async () => ( {})); // Next.js allows undefined to be returned from a getInitialPropsFunction. | ||
const activeSpan = getActiveSpan(); | ||
const requestSpan = _nullishCoalesce(getSpanFromRequest(req), () => ( (activeSpan ? getRootSpan(activeSpan) : undefined))); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
initialProps._sentryTraceData = sentryTrace; | ||
} | ||
if (requestSpan) { | ||
const sentryTrace = spanToTraceHeader(requestSpan); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
initialProps._sentryTraceData = sentryTrace; | ||
} | ||
const dynamicSamplingContext = getDynamicSamplingContextFromSpan(requestSpan); | ||
const baggage = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
initialProps._sentryBaggage = baggage; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
initialProps._sentryBaggage = baggage; | ||
} | ||
@@ -60,0 +52,0 @@ |
@@ -1,6 +0,3 @@ | ||
import { _nullishCoalesce } from '@sentry/utils'; | ||
import { getActiveSpan, spanToTraceHeader, getDynamicSamplingContextFromSpan, getRootSpan } from '@sentry/core'; | ||
import { dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils'; | ||
import { isBuild } from './utils/isBuild.js'; | ||
import { getSpanFromRequest, withTracedServerSideDataFetcher, withErrorInstrumentation } from './utils/wrapperUtils.js'; | ||
import { withTracedServerSideDataFetcher, withErrorInstrumentation } from './utils/wrapperUtils.js'; | ||
@@ -34,23 +31,17 @@ /** | ||
const serverSideProps = await (tracedGetServerSideProps.apply(thisArg, args) | ||
const { | ||
data: serverSideProps, | ||
baggage, | ||
sentryTrace, | ||
} = await (tracedGetServerSideProps.apply(thisArg, args) ); | ||
); | ||
if (serverSideProps && 'props' in serverSideProps) { | ||
const activeSpan = getActiveSpan(); | ||
const requestSpan = _nullishCoalesce(getSpanFromRequest(req), () => ( (activeSpan ? getRootSpan(activeSpan) : undefined))); | ||
if (requestSpan) { | ||
const sentryTrace = spanToTraceHeader(requestSpan); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
(serverSideProps.props )._sentryTraceData = sentryTrace; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (sentryTrace) { | ||
(serverSideProps.props )._sentryTraceData = sentryTrace; | ||
} | ||
const dynamicSamplingContext = getDynamicSamplingContextFromSpan(requestSpan); | ||
const baggage = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext); | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
(serverSideProps.props )._sentryBaggage = baggage; | ||
} | ||
// The Next.js serializer throws on undefined values so we need to guard for it (#12102) | ||
if (baggage) { | ||
(serverSideProps.props )._sentryBaggage = baggage; | ||
} | ||
@@ -57,0 +48,0 @@ } |
@@ -16,3 +16,3 @@ import { isBuild } from './utils/isBuild.js'; | ||
return new Proxy(origGetStaticPropsa, { | ||
apply: (wrappingTarget, thisArg, args) => { | ||
apply: async (wrappingTarget, thisArg, args) => { | ||
if (isBuild()) { | ||
@@ -19,0 +19,0 @@ return wrappingTarget.apply(thisArg, args); |
type RequestInfo = { | ||
url: string; | ||
path: string; | ||
method: string; | ||
@@ -4,0 +4,0 @@ headers: Record<string, string | string[] | undefined>; |
@@ -44,3 +44,7 @@ /// <reference types="node" /> | ||
dataFetchingMethodName: string; | ||
}): (...params: Parameters<F>) => Promise<ReturnType<F>>; | ||
}): (...params: Parameters<F>) => Promise<{ | ||
data: ReturnType<F>; | ||
sentryTrace?: string; | ||
baggage?: string; | ||
}>; | ||
/** | ||
@@ -47,0 +51,0 @@ * Call a data fetcher and trace it. Only traces the function if there is an active transaction on the scope. |
export { withSentryConfig } from './withSentryConfig'; | ||
export { SentryBuildOptions } from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
type RequestInfo = { | ||
url: string; | ||
path: string; | ||
method: string; | ||
@@ -4,0 +4,0 @@ headers: Record<string, string | string[] | undefined>; |
@@ -44,3 +44,7 @@ /// <reference types="node" /> | ||
dataFetchingMethodName: string; | ||
}): (...params: Parameters<F>) => Promise<ReturnType<F>>; | ||
}): (...params: Parameters<F>) => Promise<{ | ||
data: ReturnType<F>; | ||
sentryTrace?: string; | ||
baggage?: string; | ||
}>; | ||
/** | ||
@@ -47,0 +51,0 @@ * Call a data fetcher and trace it. Only traces the function if there is an active transaction on the scope. |
export { withSentryConfig } from './withSentryConfig'; | ||
export type { SentryBuildOptions } from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@sentry/nextjs", | ||
"version": "8.25.0", | ||
"version": "8.26.0", | ||
"description": "Official Sentry SDK for Next.js", | ||
@@ -74,9 +74,9 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"@rollup/plugin-commonjs": "26.0.1", | ||
"@sentry/core": "8.25.0", | ||
"@sentry/node": "8.25.0", | ||
"@sentry/opentelemetry": "8.25.0", | ||
"@sentry/react": "8.25.0", | ||
"@sentry/types": "8.25.0", | ||
"@sentry/utils": "8.25.0", | ||
"@sentry/vercel-edge": "8.25.0", | ||
"@sentry/core": "8.26.0", | ||
"@sentry/node": "8.26.0", | ||
"@sentry/opentelemetry": "8.26.0", | ||
"@sentry/react": "8.26.0", | ||
"@sentry/types": "8.26.0", | ||
"@sentry/utils": "8.26.0", | ||
"@sentry/vercel-edge": "8.26.0", | ||
"@sentry/webpack-plugin": "2.20.1", | ||
@@ -83,0 +83,0 @@ "chalk": "3.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1804906
10700
+ Added@opentelemetry/instrumentation-fs@0.14.0(transitive)
+ Added@sentry-internal/browser-utils@8.26.0(transitive)
+ Added@sentry-internal/feedback@8.26.0(transitive)
+ Added@sentry-internal/replay@8.26.0(transitive)
+ Added@sentry-internal/replay-canvas@8.26.0(transitive)
+ Added@sentry/browser@8.26.0(transitive)
+ Added@sentry/core@8.26.0(transitive)
+ Added@sentry/node@8.26.0(transitive)
+ Added@sentry/opentelemetry@8.26.0(transitive)
+ Added@sentry/react@8.26.0(transitive)
+ Added@sentry/types@8.26.0(transitive)
+ Added@sentry/utils@8.26.0(transitive)
+ Added@sentry/vercel-edge@8.26.0(transitive)
- Removed@sentry-internal/browser-utils@8.25.0(transitive)
- Removed@sentry-internal/feedback@8.25.0(transitive)
- Removed@sentry-internal/replay@8.25.0(transitive)
- Removed@sentry-internal/replay-canvas@8.25.0(transitive)
- Removed@sentry/browser@8.25.0(transitive)
- Removed@sentry/core@8.25.0(transitive)
- Removed@sentry/node@8.25.0(transitive)
- Removed@sentry/opentelemetry@8.25.0(transitive)
- Removed@sentry/react@8.25.0(transitive)
- Removed@sentry/types@8.25.0(transitive)
- Removed@sentry/utils@8.25.0(transitive)
- Removed@sentry/vercel-edge@8.25.0(transitive)
Updated@sentry/core@8.26.0
Updated@sentry/node@8.26.0
Updated@sentry/opentelemetry@8.26.0
Updated@sentry/react@8.26.0
Updated@sentry/types@8.26.0
Updated@sentry/utils@8.26.0
Updated@sentry/vercel-edge@8.26.0