Skip to content

fix(core): Use safeDateNow calls for new Date() reads#21351

Draft
chargome wants to merge 1 commit into
developfrom
cg/cachecomponents-error
Draft

fix(core): Use safeDateNow calls for new Date() reads#21351
chargome wants to merge 1 commit into
developfrom
cg/cachecomponents-error

Conversation

@chargome
Copy link
Copy Markdown
Member

@chargome chargome commented Jun 5, 2026

Several spots in core read the ambient clock directly via a bare new Date(). In Next.js Cache Components this throws a next-prerender-current-time violation, breaking captureException/captureMessage in dev and at runtime during ISR/on-demand revalidation.

closes #21333

@chargome chargome self-assigned this Jun 5, 2026
@chargome chargome requested a review from logaretm June 5, 2026 14:53
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.21 kB +0.01% +2 B 🔺
@sentry/browser - with treeshaking flags 25.65 kB +0.01% +2 B 🔺
@sentry/browser (incl. Tracing) 45.51 kB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 47.73 kB +0.02% +5 B 🔺
@sentry/browser (incl. Tracing, Profiling) 50.29 kB +0.01% +3 B 🔺
@sentry/browser (incl. Tracing, Replay) 84.71 kB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 74.34 kB +0.02% +10 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 89.41 kB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 102.11 kB +0.01% +5 B 🔺
@sentry/browser (incl. Feedback) 44.37 kB +0.01% +2 B 🔺
@sentry/browser (incl. sendFeedback) 32.02 kB +0.01% +3 B 🔺
@sentry/browser (incl. FeedbackAsync) 37.11 kB +0.01% +2 B 🔺
@sentry/browser (incl. Metrics) 28.28 kB +0.02% +3 B 🔺
@sentry/browser (incl. Logs) 28.52 kB +0.02% +3 B 🔺
@sentry/browser (incl. Metrics & Logs) 29.22 kB +0.02% +4 B 🔺
@sentry/react 29.02 kB +0.01% +1 B 🔺
@sentry/react (incl. Tracing) 47.78 kB +0.01% +3 B 🔺
@sentry/vue 32.23 kB +0.02% +4 B 🔺
@sentry/vue (incl. Tracing) 47.4 kB +0.01% +3 B 🔺
@sentry/svelte 27.23 kB +0.01% +2 B 🔺
CDN Bundle 29.58 kB - -
CDN Bundle (incl. Tracing) 47.96 kB +0.01% +4 B 🔺
CDN Bundle (incl. Logs, Metrics) 31.09 kB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 49.2 kB +0.02% +6 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 70.37 kB +0.01% +3 B 🔺
CDN Bundle (incl. Tracing, Replay) 85.34 kB +0.01% +3 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.51 kB +0.01% +2 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 91.16 kB +0.01% +3 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.34 kB +0.01% +3 B 🔺
CDN Bundle - uncompressed 87.7 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 144.91 kB +0.01% +12 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 92.19 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 148.67 kB +0.01% +12 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 217.01 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 263.78 kB +0.01% +12 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 267.52 kB +0.01% +12 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 277.48 kB +0.01% +12 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 281.21 kB +0.01% +12 B 🔺
@sentry/nextjs (client) 50.26 kB +0.01% +3 B 🔺
@sentry/sveltekit (client) 45.93 kB +0.01% +3 B 🔺
@sentry/core/server 75.95 kB +0.02% +9 B 🔺
@sentry/core/browser 63.1 kB +0.02% +7 B 🔺
@sentry/node-core 61.7 kB +0.01% +2 B 🔺
@sentry/node 130.41 kB +0.01% +7 B 🔺
@sentry/node - without tracing 74.08 kB +0.01% +3 B 🔺
@sentry/aws-serverless 86.27 kB +0.01% +6 B 🔺
@sentry/cloudflare (withSentry) - minified 173.61 kB +0.02% +20 B 🔺
@sentry/cloudflare (withSentry) 433.71 kB -0.01% -25 B 🔽

View base workflow run

@chargome
Copy link
Copy Markdown
Member Author

chargome commented Jun 5, 2026

bugbot run

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 36810c4. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sentry.captureException/captureMessage break Next.js prerendering with Cache Components enabled

2 participants