Affected: JavaScript-based SDKs
Overview
Reference this document when experiencing issues when using the JavaScript SDK.
JavaScript SDK Errors
Error Message
|
Description
|
Cause |
Steps to resolve |
413 HTTP error code
|
The error appears when attempting to evaluate a context with a context object that is too large. |
The context object exceeds the maximum allowed size for the request URL. |
- Reduce the size of the context object passed to the SDK.
- Use the
useReport option in the SDK configuration:
- This places the context in the body of the HTTP request instead of the URL.
- Note: Enabling
useReport results in slower SDK performance because it bypasses edge caching and requires direct communication with LaunchDarkly.
- Ensure compatibility with streaming by using the LaunchDarkly Requirements and polyfills.
|
414 HTTP error code
|
The error occurs during SDK initialization when the context object exceeds browser URL size limitations.
|
The context object is too large for the browser's URL character limit (2048 characters). |
- Reduce the size of the JSON context object:
- Limit the number of attributes and nested data structures.
- Aim for the object to be under 1481 characters, accounting for base64 encoding.
- Consider using the server-side SDK or other methods that do not depend on URL-based transmission for large payloads.
|
Error on stream connection: {"isTrusted":true}, will continue retrying every 1000 milliseconds
|
The message {"isTrusted":true} appears when the streaming connection ends unexpectedly.
|
Network interruptions or configurations that prevent long-lived connections. |
- Verify the network configuration to ensure long-lived connections are allowed.
- Address potential network disruptions or browser policies that might terminate connections unexpectedly.
|
XHR Errors in Older SDK Versions
|
These errors may appear if an end user closes a page.
|
These errors stem from an SDK bug present in versions earlier than 3.1.4. |
Update the SDK to version 3.1.4 or later. This resolves known issues related to page closures.
|
Resources