Troubleshooting
Solutions for common issues encountered when integrating the Lovina Chat SDK.
Widget Does Not Appear
The chat bubble is not visible
-
Check the browser console for errors. Open developer tools and look for messages starting with
[Lovina]. -
Verify your configuration. Ensure
websiteTokenandbaseUrlare correct:window.lovinaChatSDK.run({websiteToken: "YOUR_WEBSITE_TOKEN", // Must match your dashboardbaseUrl: "https://chat.ailovina.com", // Must be reachable}); -
Check
hideMessageBubble. If set totrue, the bubble is intentionally hidden. Open the chat programmatically:window.$lovina.toggle("open"); -
Check script loading order.
window.lovinaSettingsmust be defined before callingwindow.lovinaChatSDK.run(). -
Check for CSS conflicts. Ensure no styles on your page are setting
z-indexhigh enough to cover the widget (the SDK usesz-index: 2147483000).
The widget loads but shows a blank screen
- Verify the
baseUrlis reachable. Open{baseUrl}/widgetin a new browser tab. - Check for mixed content. If your site is served over HTTPS, the
baseUrlmust also use HTTPS.
CSP (Content Security Policy) Issues
If your site uses a Content Security Policy, the SDK requires these directives:
frame-src https://chat.ailovina.com;
script-src https://chat.ailovina.com;
connect-src https://chat.ailovina.com;
img-src https://chat.ailovina.com;
Replace https://chat.ailovina.com with your actual baseUrl if you are self-hosting.
Symptoms of CSP issues
- Widget iframe does not load (check console for
Refused to frameerrors). - WebSocket connections are blocked (check console for
Refused to connecterrors). - Images or uploaded files do not display.
How to diagnose
Open the browser console (F12) and filter for "Refused" or "CSP" errors. Each blocked resource will indicate which CSP directive needs updating.
CORS Errors
Symptoms
Access-Control-Allow-Originerrors in the browser console.- Messages fail to send with network errors.
Solutions
- Verify
baseUrl/apiUrlare correct -- they must match the intended environment's actual host (including protocol and port); a request reaching the wrong environment will look like a CORS failure. - Check for proxy interference -- reverse proxies (nginx, Cloudflare) may strip or modify CORS headers.
- Still failing? Contact support with your
websiteTokenand the exact origin your site is served from -- your account may need to be configured to allow it.
WebView Debugging
Android
- Enable WebView debugging in your app:
WebView.setWebContentsDebuggingEnabled(true)
- Connect the device via USB.
- Open
chrome://inspectin Chrome on your computer. - Select the WebView from the list to open DevTools.
iOS
- Enable Web Inspector in Safari on the device: Settings > Safari > Advanced > Web Inspector.
- Connect the device via USB.
- Open Safari on your Mac, go to Develop > [Device Name] and select the WebView.
Common WebView issues
- File picker does not open -- See the File Upload guide for platform-specific WebView setup.
- Cookies not persisting -- Ensure the WebView allows cookies and local storage.
- JavaScript disabled -- Verify
javaScriptEnabledistruein WebView settings. - Composer overlaps the Android system nav bar -- Call
enableEdgeToEdge()in your Activity'sonCreate(), right aftersuper.onCreate()and beforesetContentView(...). This is required for the widget's safe-area CSS to see a real inset, but it also disables Android's automatic keyboard-resize behavior -- pair it with aViewCompat.setOnApplyWindowInsetsListenerthat sets your root view's bottom padding to the IME inset, so the WebView still shrinks correctly when the keyboard opens. Leave system-bar insets unhandled; the WebView needs to keep extending behind them for the safe-area CSS to work. - Composer is pushed off-screen by the keyboard on Flutter -- The widget already handles keyboard insets itself. Don't wrap
LovinaChatWidgetin your ownPadding(padding: MediaQuery.viewInsetsOf(context)), and don't setresizeToAvoidBottomInset: falseon a hostScaffoldand compensate manually -- either one double-compensates and strands the composer a further keyboard height off-screen.
File Upload Not Working
Files are not uploading
-
Check the feature flag. Ensure file upload is not disabled:
window.lovinaSettings = {features: {enable_file_upload: true,},}; -
Check file size. Files must be under 5 MB each.
-
Check file count. Maximum 5 files per message.
-
Check accepted types. Only
image/*,application/pdf,text/*,audio/*, andvideo/*are accepted.
File picker does not open on mobile
On Android and iOS WebViews, the native file picker requires platform-specific configuration. See the File Upload guide for setup instructions.
Uploads fail with network errors
- Check that the
baseUrlsupports multipart form data uploads. - Verify there is no file size limit set by a reverse proxy (nginx default is often 1 MB -- raise
client_max_body_sizeto at least6m, which leaves headroom above the 5 MB file limit for multipart overhead). - Check for CORS issues on the upload endpoint. CORS headers must also be present on error responses (in nginx, add them with the
alwaysparameter); otherwise the browser hides a413and the widget can only report a generic network error.
Messages Are Not Sending
-
Check network connectivity. Open the Network tab in developer tools and look for failed requests to
/sdk/chat/. -
Verify the websiteToken. An invalid token results in 401 responses.
-
Enable debug mode for detailed console output:
window.lovinaSettings = {features: { debug_mode: true },};
User Identity Not Persisting
-
Check cookies. The SDK stores session data in cookies. Ensure your site is not blocking or clearing cookies on navigation.
-
Call
setUserafterlovina:ready. Setting the user before the widget loads has no effect:window.addEventListener("lovina:ready", function () {window.$lovina.setUser("user-123", { name: "Jane" });});
Settings Not Updating
window.lovinaSettings is read once during initialization. To change settings at runtime:
- Use API methods:
setLocale(),setColorScheme(),toggle(), etc. - For settings without a runtime API, call
destroy()and reinitialize:window.$lovina.destroy();window.lovinaSettings = {/* new settings */};window.lovinaChatSDK.run({ websiteToken: "...", baseUrl: "..." });
Dark Mode Not Working
- Check the
colorSchemesetting. It should be'dark'or'auto'. - If using
'auto', verify your OS is set to dark mode. The widget followsprefers-color-scheme. - Runtime toggle:
window.$lovina.setColorScheme("dark");
Transport / Connection Issues
The SDK supports three transport protocols with automatic fallback: WebSocket, SSE, and Long Polling. If you experience connection issues:
-
Check firewall rules. SSE connections may be blocked by corporate firewalls or proxies. Ensure your network allows long-lived HTTP connections to the backend.
-
Force a specific transport for debugging:
window.lovinaSettings = {features: {enable_websocket: false,enable_sse: false,enable_long_polling: true, // Only use long polling},}; -
Check proxy configuration. Some reverse proxies (nginx, HAProxy) require explicit WebSocket upgrade configuration.
Which Build Is Deployed?
If the widget's behavior doesn't match what you expect -- a fix that "should already be live," or an unexplained 400/401 that might be a stale or misconfigured deployment -- you can check exactly which build is running at a given host without opening a support ticket first:
curl https://chat.ailovina.com/build-info.json
Replace https://chat.ailovina.com with your own baseUrl if self-hosting. This returns:
{
"version": "1.2.0",
"gitSha": "a1b2c3d4e5f6...",
"builtAt": "2026-03-01T12:00:00.000Z",
"rumEnv": "production",
"apiVersion": "v1",
"apiUrlSource": "baked",
"wsUrlSource": "derived"
}
version/gitSha/builtAt-- confirms the deployment actually shipped the build you expect, rather than an older cached one.apiUrlSource/wsUrlSource--"derived"means that URL was not set when the widget was built, so the widget is guessing it from the page's own host at runtime instead of using a fixed backend address. If the widget appears to be reaching the wrong backend, this is a common cause -- ask whoever deployed the widget to set the corresponding backend URL explicitly at build time.
Getting Help
If you cannot resolve the issue:
- Enable
debug_mode: trueand reproduce the problem. - Copy the console output.
- Note your browser, OS, and SDK version.
- Contact support@ailovina.com with the above information.