-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
9.43
Framework Version
Next 15.4.6
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
- Upgrade @sentry/nextjs from 9.42 (works) to 9.43+ (issue persists in 10.5).
- Build the app and navigate to a page with revalidate set.
- Observe that x-nextjs-cache transitions from STALE → HIT.
- However, Server Component data does not update.
- Console error:
-- [Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] { digest: 'DYNAMIC_SERVER_USAGE' }
-- cache-control response header has s-maxage=30 (unexpected). - Downgrade back to 9.42 → issue disappears.
- In sentry.server.config.ts, setting sendDefaultPii: false also resolves the issue.
// sentry.server.config.ts
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: process.env.NEXT_PUBLIC_ENV,
sendDefaultPii: true,
sampleRate: 0.1,
maxBreadcrumbs: 10,
});
// instrumentation.ts
import * as Sentry from "@sentry/nextjs";
export async function register() {
if (process.env.NEXT_RUNTIME === "nodejs") {
await import("../sentry.server.config");
if (process.env.NEXT_PUBLIC_ENV !== "development") {
await import("../logger.config");
await import("../opentelemetry.config");
}
}
if (process.env.NEXT_RUNTIME === "edge") {
await import("../sentry.edge.config");
}
}
export const onRequestError = Sentry.captureRequestError;
Expected Result
- Server cache should revalidate correctly.
- Enabling sendDefaultPii: true should not break caching.
Actual Result
- With sendDefaultPii: true, cache never refreshes.
- Server Component rendering fails with a cryptic DYNAMIC_SERVER_USAGE error.
cbovis
Metadata
Metadata
Assignees
Projects
Status
No status