Skip to content

Debugging & troubleshooting

Debug mode

js
Moderok.init({
  appKey: "mk_...",
  debug: true,
});

Logs are prefixed with [moderok]: enqueue, flush, transport results, dropped properties, oversized events, and more.

Common issues

What you seeWhat to check
No __install / __updateCall Moderok.init() synchronously at top level in the background service worker (Initialization).
Events from popup but not backgroundCall init() in each context where you track(), or send messages to the background (Patterns).
CORS or network errorsConfirm the endpoint (if you override it) and that the API is reachable (Manifest).
chrome.runtime.lastError not in reportsUse captureLastError() in the callback (Error tracking).
Properties missingOnly string / number / boolean; nested values are dropped (Events).
Queue growsOffline or server errors can keep batches for retry. Fix connectivity or endpoint; use debug: true to see status codes.
Too many duplicate errorsThe SDK deduplicates bursts; captureConsoleErrors adds noise. Enable it only if you need it.

Graceful shutdown (rare)

If your extension has a dedicated shutdown path:

js
await Moderok.shutdown();

This stops timers, flushes, and tears down error listeners. Most MV3 extensions do not need this.

Moderok: analytics for browser extensions