Repository navigation
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
11.10.0
Framework Version
Next 16.4.3 (Node 24.13.1)
Link to Sentry event
No response
Reproduction Example/SDK Setup
// Server side (Node runtime), @sentry/nextjs 11.10.0
const Sentry = require('@sentry/nextjs');
Sentry.init({
dsn: '',
debug: true,
beforeSend(event) {
console.log('beforeSend saw:', event.exception?.values?.[0]?.type);
return event;
},
});
const ordinary = new Error('an ordinary message');
ordinary.name = 'Ordinary';
Sentry.captureException(ordinary); // reaches beforeSend
const withObject = new Error('placeholder');
withObject.name = 'WithObject';
withObject.message = { code: 42 };
Sentry.captureException(withObject); // dropped
const withNumber = new Error('placeholder');
withNumber.name = 'WithNumber';
withNumber.message = 42;
Sentry.captureException(withNumber); // dropped
Steps to Reproduce
- Initialize @sentry/nextjs on the server with debug: true.
- Capture an Error whose message is not a string (an object, a number, a bigint or a function).
- The same happens when such an error is logged with console.error(error) while captureConsoleIntegration is enabled.
Expected Result
Expected Result:
The event is sent, like any other error. A message that is not a string should not make an event processor throw.
Actual Result
The event is dropped before beforeSend runs. With debug: true:
Sentry Logger [error]: Event processor "DropReactControlFlowErrors" threw an error, dropping event: TypeError: exceptionMessage?.includes is not a function
at .../node_modules/@sentry/nextjs/build/cjs/common/utils/dropReactControlFlowErrors.js:19:27
Sentry Logger [log]: Recording outcome: "callback_error:error"
### Additional Context
- Additional Context:
- Reproduced on 11.10.0. The same lines are in 11.12.0: https://github.com/getsentry/sentry-javascript/blob/11.12.0/packages/nextjs/src/common/utils/dropReactControlFlowErrors.ts#L32-L35
- Workaround I use: an integration with preprocessEvent that replaces a non-string exception.values[i].value with a short placeholder before the event processors run.
- Possibly related, and maybe a separate issue: for an Error whose message is a Symbol, Sentry.captureException(error) throws to the caller (TypeError: Cannot convert a Symbol value to a string, raised while error.stack is read), and a following await Sentry.flush(5000) had not resolved after 25 seconds.
### Priority
<sub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.</sub>
Metadata
Metadata
Assignees
Projects
- StatusShow more project fieldsWaiting for: Product Owner
Activity
linear-code commentedon Nov 12, 2026
JS-4100
bardrop commentedon Nov 12, 2026
I'd like to fix this one if that's OK. The plan is a small change in
dropReactControlFlowErrors.ts: only call.includes()when the exception value is a string, plus a unit test with a numeric and an objectmessage. Does that sound right, or would you rather turn the value into a string earlier, where the exception is built in core?msonnb commentedon Nov 13, 2026
Hey @bardrop, I think we should fix that in core by making sure that
_enhanceErrorWithSentryInfoonly returns a string. You can go ahead an open a PR if you want, thank you!bardrop commentedon Nov 13, 2026
Thanks! Opened #26349 with the fix in core:
_enhanceErrorWithSentryInfonow always returns a string.fix(core): Always return a string from `_enhanceErrorWithSentryInfo` (g…
github-actions commentedon Nov 16, 2026
A PR closing this issue has just been released 🚀
This issue was referenced by PR #26349, which was included in the 11.13.0 release.