Skip to content

fix(core): Guard against undefined chained in copyProps#20637

Merged
nicohrubec merged 1 commit intodevelopfrom
fix/copyprops-undefined-chained
May 4, 2026
Merged

fix(core): Guard against undefined chained in copyProps#20637
nicohrubec merged 1 commit intodevelopfrom
fix/copyprops-undefined-chained

Conversation

@nicohrubec
Copy link
Copy Markdown
Member

@nicohrubec nicohrubec commented May 4, 2026

Non-standard thenables (e.g. Fastify reply objects) can return undefined from .then(), which crashes copyProps with TypeError: Cannot use 'in' operator to search for 'raw' in undefined. Added a guard to return the original object as fallback when chained is falsy.

Closes #20623

Non-standard thenables (e.g. Fastify reply objects) can return `undefined` from `.then()`, causing a `TypeError` in `copyProps` when using the `in` operator on `undefined`. Return the original object as fallback.

Closes #20623

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 26.31 kB +0.03% +6 B 🔺
@sentry/browser - with treeshaking flags 24.8 kB +0.02% +3 B 🔺
@sentry/browser (incl. Tracing) 44.2 kB +0.02% +7 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 46.42 kB +0.02% +6 B 🔺
@sentry/browser (incl. Tracing, Profiling) 49.16 kB +0.02% +6 B 🔺
@sentry/browser (incl. Tracing, Replay) 83.58 kB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 73.04 kB +0.01% +4 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 88.26 kB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 100.87 kB +0.01% +6 B 🔺
@sentry/browser (incl. Feedback) 43.47 kB +0.02% +5 B 🔺
@sentry/browser (incl. sendFeedback) 31.12 kB +0.02% +5 B 🔺
@sentry/browser (incl. FeedbackAsync) 36.21 kB +0.02% +4 B 🔺
@sentry/browser (incl. Metrics) 27.62 kB +0.02% +5 B 🔺
@sentry/browser (incl. Logs) 27.75 kB +0.03% +6 B 🔺
@sentry/browser (incl. Metrics & Logs) 28.45 kB +0.02% +5 B 🔺
@sentry/react 28.05 kB +0.02% +3 B 🔺
@sentry/react (incl. Tracing) 46.42 kB +0.01% +3 B 🔺
@sentry/vue 31.18 kB +0.02% +4 B 🔺
@sentry/vue (incl. Tracing) 46.04 kB +0.02% +7 B 🔺
@sentry/svelte 26.34 kB +0.02% +5 B 🔺
CDN Bundle 28.91 kB +0.02% +4 B 🔺
CDN Bundle (incl. Tracing) 46.95 kB +0.02% +5 B 🔺
CDN Bundle (incl. Logs, Metrics) 30.34 kB +0.02% +5 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 48.06 kB +0.01% +4 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 69.41 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing, Replay) 84.11 kB +0.01% +4 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 85.16 kB +0.01% +3 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 89.91 kB +0.01% +3 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 91.01 kB +0.01% +4 B 🔺
CDN Bundle - uncompressed 84.72 kB +0.02% +15 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 140.31 kB +0.02% +15 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 88.92 kB +0.02% +15 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 143.77 kB +0.02% +15 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 212.86 kB +0.01% +15 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 258.11 kB +0.01% +15 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 261.56 kB +0.01% +15 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 271.81 kB +0.01% +15 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 275.25 kB +0.01% +15 B 🔺
@sentry/nextjs (client) 48.92 kB +0.01% +3 B 🔺
@sentry/sveltekit (client) 44.67 kB +0.02% +5 B 🔺
@sentry/node-core 59.13 kB +0.03% +16 B 🔺
@sentry/node 170.42 kB +0.01% +17 B 🔺
@sentry/node - without tracing 97 kB +0.02% +15 B 🔺
@sentry/aws-serverless 113.85 kB +0.04% +35 B 🔺
@sentry/cloudflare (withSentry) - minified 165.2 kB +0.01% +15 B 🔺
@sentry/cloudflare (withSentry) 417.71 kB +0.01% +33 B 🔺

View base workflow run

@nicohrubec nicohrubec marked this pull request as ready for review May 4, 2026 10:58
@nicohrubec nicohrubec merged commit 4034c52 into develop May 4, 2026
257 checks passed
@nicohrubec nicohrubec deleted the fix/copyprops-undefined-chained branch May 4, 2026 11:01
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.

TypeError: Cannot use 'in' operator in copyProps when chained promise is undefined

2 participants