Troubleshooting
Overview
Most issues fall into a few buckets: the stylesheet import, host z-index, credentials (especially the JWT _id), viewport height and bundler config. Related guides: Project setup, Host app integration and FAQ.
Quick lookup
Install / TypeScript
“Cannot find module '@realtimexsco/live-chat' or its type declarations” - types didn't install correctly:
npm ls @realtimexsco/live-chatls node_modules/@realtimexsco/live-chat/dist/index.d.tsIf the .d.ts is missing, reinstall (rm -rf node_modules && npm install).
A dependency (zustand, firebase, videosdk, lexical, dompurify, …) didn't install - these are regular dependencies of the package, not peers, and install automatically. Don't add Lexical or DOMPurify to your app. If one is missing, your lockfile is stale: delete it and node_modules, then reinstall.
Rich-text formatting looks wrong (no bold, lists, mentions) - make sure styles.css is imported; the Lexical theme classes are pre-compiled into it.
Styling
Chat renders completely unstyled - styles.cssisn't imported, or a stale pre-1.7 copy is cached. Older versions relied on the host's Tailwind @source; current versions ship a fully pre-compiled stylesheet. For a linked package, rebuild and reinstall.
Brand accent (buttons, links, badges) is grey/black - themeColor sets the --chat-theme* variables at runtime, but anything rendered before mount (or outside <ChatMain>) needs a fallback:
:root { --chat-theme: #6366f1; --chat-theme-5: #6366f10D; --chat-theme-10: #6366f11A; --chat-theme-20: #6366f133; --chat-theme-40: #6366f166; --chat-theme-60: #6366f199;}Whole page scrolls instead of the message list - give ChatMain a height (viewportHeight) and let ancestors shrink (min-h-0).
Modals & popups
- Modal doesn't appear - usually missing
styles.cssor a host sidebarz-indexabove the chat overlay. Inspect[data-slot="dialog-content"]- see Host app integration. - No backdrop or wrong colours - stylesheet missing, or sub-components rendered outside
<ChatMain />(no theme provider). - Works on one route, broken on another- that route's layout doesn't load global CSS. Move the import to the root layout's
globals.css. - Host styles changed after installing chat -
styles.cssadds shadcn-compatible:rootfallbacks. Re-declare your tokens after the package import.
Calling
ERROR_OPERATION_IN_PROGRESS: A join request is already in progress. - @videosdk.live/react-sdk is on the wrong major. The package is built against 0.13.3; 1.x auto-joins and collides. Pin it, restart the dev server and hard-reload:
npm ls @videosdk.live/react-sdknpm install @videosdk.live/react-sdk@0.13.3Video call crashes with unstable_NormalPriority (pnpm only) - add "@realtimexsco/live-chat > @videosdk.live/react-sdk" to optimizeDeps.include (see Project setup).
504 (Outdated Optimize Dep) for everything - Vite's node_modules/.vite cache went stale. Stop and restart the dev server, then hard-reload (Ctrl+Shift+R).
Recording button does nothing- only the call's host can record. RECORDING_DISABLED means the workspace setting is off (enforced server-side).
Whiteboard button missing - check whiteboardEnabled (Admin permissions) and that calling itself works.
Local package development
When linking via "file:../path/to/realtimex-npm-package":
- Bundlers use the built
dist/, notsrc/- rebuild (npm run build, ornpm run devto watch) after every change. - After the first link or any dependency change, reinstall in the host app too.
- Odd VideoSDK errors after a rebuild: delete the host's
node_modules/.viteand restart.
Auth / data
Messages on the wrong side, or contacts empty - loggedUserDetails._iddoesn't match the _id in your JWT. Decode and compare:
JSON.parse(atob(token.split(".")[1]));Requests blocked by CORS in local dev - see the dev proxy in Project setup.
Setup checklist
react+react-dominstalled -tailwindcssis not required.@realtimexsco/live-chatinstalled (Lexical and DOMPurify come with it).- pnpm + Vite: nested
@realtimexsco/live-chat > …entries inoptimizeDeps.include. styles.cssimported once, globally.- Chat inside a sized container, with the right
viewportHeight. - Chat modals verified above a high-z-index host sidebar.
chat.config.tswithclientId,accessToken,loggedUserDetails(_idmatching the JWT) andapiUrlending in/api/v1.- Next.js:
"use client"andtranspilePackages. - Web push:
firebase-messaging-sw.jsinpublic/; Electron:window.desktopbridge. onSessionEndwired to your sign-in screen (andrefreshTokenpassed).- Custom slots honor admin gates (
useAdminFeatureGate).