ScaleBun
Skip to article

Troubleshooting

webDeveloper

What to check when data is not arriving, the built-in diagnostics helpers, and the init behaviors that most often surprise people.

Updated Reviewed

Nothing is arriving#

Work down this list:

  1. Check the console. init() never throws — on a bad config it logs [scalebun] init failed: … and leaves the SDK inert. That warning is your first clue.

  2. Confirm both required fields. clientKey and apiBaseUrl are mandatory; a missing one leaves the SDK silently inert.

  3. Call init() on the client. It must run in the browser, not during SSR, and as early as possible.

  4. Check consent. With requireConsent: true, nothing is captured until setConsent(true) is called.

  5. Check CSP. If the ingestion API is blocked by connect-src, requests never leave the browser. See Privacy & consent.

Diagnostics#

The SDK exposes live counters and a manual flush you can call from the console:

TypeScript
ScaleBun.sessionId;         // the current session id — quote this in a support ticketScaleBun.egressStats();     // { pending, dropped } across both lanesScaleBun.errorStats();      // captured, dropped-by-reason, by type, breadcrumb countScaleBun.networkStats();    // captured, by protocol, by failure, dropped, bodiesScaleBun.perfStats();       // transactions, dropped, resources, jank, sample rateScaleBun.analyticsStats();  // pending, dropped, sampledOut, flushes, sampleRateScaleBun.replay.stats();    // null when this session isn't being recordedScaleBun.watchdog.stats();  // null unless the watchdog is enabled
await ScaleBun.flush(); // force-send both lanes nowawait ScaleBun.close(); // flush and shut down

pending climbing while dropped stays at zero means egress is blocked, not that capture is broken — check the network tab and connect-src. dropped climbing means the queue is overflowing, which is a volume or connectivity problem rather than a configuration one.

A feature does nothing and reports no error#

Most "it silently does nothing" reports are one of these.

SymptomCause
A controller's methods do nothing, foreverIt was read before init() resolved. Accessors return a no-op object rather than throwing. await ScaleBun.whenReady() first.
The inbox is always emptyfeatures.inbox is off by default, and the disabled controller is a no-op.
In-app messages never renderSame, for features.inapp2 — or an inline campaign with no registered slot, which falls back to a modal.
Push does nothing after enablePush()/scalebun-push-sw.js is not served from your origin, or the call was not made from a user gesture.
profiler.start() returns falseThe document is not served with Document-Policy: js-profiling.
No replay for a sessionIt was not sampled. ScaleBun.replay.stats() returns null — that is the answer, not a bug.
A segment-targeted campaign never showsThe visitor is still anonymous. Call identify() — segments cannot resolve without a user.
An inline message renders nowhereThe slot element unmounted without being unregistered, so it points at a detached node.

Things that surprise people#

Next#

Troubleshooting · Web SDK · ScaleBun