Skip to main content

[JavaScript] Why is the message in my error being truncated?

Issue

I captured a message with the JavaScript SDK, and the text is cut off at about 250 characters, including in the event JSON. I need the full message.

[Screenshot: Issue Details showing a truncated message ending in an ellipsis.]

Applies To

  • All SaaS Customers and Self-Hosted Users

  • JavaScript SDK

  • Error Monitoring

Resolution

Use maxValueLength in Sentry.init to control client-side string truncation. Truncated data that already reached Sentry cannot be restored.

If your JavaScript SDK is older than 10.23.0, the SDK truncated strings to 250 characters by default. Raise the limit:

Sentry.init({
  dsn: "https://[email protected]/0",
  maxValueLength: 8192,
});

If your JavaScript SDK is 10.23.0 or later, the SDK no longer sets a default maxValueLength, so it does not truncate those strings on the client by default. You can still set maxValueLength if you want a client-side cap.

Do not set maxValueLength higher than 8192. Values that large can push the event past the payload size limit, and Sentry drops oversized events.

If the UI shows “Removed because of size limits,” that is server-side truncation, not the old 250-character client default. See How can I retrieve truncated data in Sentry?.

[Screenshot: Sentry.init configuration setting maxValueLength.]

[Screenshot: Issue Details or event JSON showing the full message after raising maxValueLength.]

Did this answer your question?