Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReferenceError: LiveKitClient is not defined when loading JS SDK (UMD) on Parrot OS

I'm trying to integrate LiveKit (using LiveKit Cloud) into my web application (Python/Flask/SocketIO backend, plain JavaScript frontend), and I'm stuck on a persistent client-side error I can't seem to resolve.

When my JavaScript code tries to create a room instance with new LiveKitClient.Room(...), I consistently get the following error: ReferenceError: LiveKitClient is not defined (Or in Firefox: ReferenceError: Can't find variable: LiveKitClient)

Environment:

  • Operating System: Parrot OS Security [Add version if known, e.g., 6.1] (Debian-based Linux)
  • Browsers Tested: [ Firefox, Google Chrome, Edge, DockDockGo] (Latest versions)
  • LiveKit Client SDK: Tested both the latest version ( 2.11.4) and an older one ( 1.5.0) using the UMD build (livekit-client.umd.min.js)
  • Loading Method: Using a <script src="..."></script> tag in the HTML, placed before my main script (chat_logic.js)
  • Backend: Flask with Python 3.11 and the livekit-api library , installed via pip. Token generation via /livekit/token is working correctly (the client receives the token before the JavaScript error occurs)

Diagnostics Performed:

  • Script Download: Verified in the browser "Network" tab. The livekit-client.umd.min.js file downloads successfully (200 OK), both from the CDN (jsDelivr, unpkg) and when served locally via Flask (static/js/)
  • Global Variable Check: After full page load, typing LiveKitClient in the browser console results in ReferenceError: LiveKitClient is not defined
  • Minimal Isolated Test: Created a minimal HTML file that only loads the UMD script from the CDN and then tries to access LiveKitClient via console.log. This minimal test also fails with the same ReferenceError, indicating the issue is not with my chat_logic.js code or app-specific conflicts
  • Browser Isolation: The error persists across different browsers (Firefox, Chrome) on this OS
  • Incognito / Extensions: The error persists in Private/Incognito mode and with all browser extensions temporarily disabled
  • Other Console Errors: The only other message occasionally seen is a third-party cookie warning (Cookie "" has been rejected as third-party.) from the LiveKit script, but no other JavaScript errors appear during page load that might indicate a script execution failure

Conclusion:

It seems that the LiveKit Client UMD script, while downloaded correctly, is either silently failing to execute or is unable to define the global LiveKitClient object in this specific environment (Parrot OS / tested browsers).

Question:

Is this a known compatibility issue with Debian-based Linux distributions (like Parrot OS) or with specific browser privacy/security configurations on Linux? Are there particular browser or OS settings that should be checked? Is there any other debugging step you would recommend to diagnose why the script might be silently failing after a successful download?

like image 1000
Kali Chad Avatar asked Dec 18 '25 07:12

Kali Chad


1 Answers

OK, working now. First, rather than using any package managers, just include a reference to the script in your js ...

<script src="https://cdn.jsdelivr.net/npm/livekit-client/dist/livekit-client.umd.min.js"></script>

This defines and exports a module called LivekitClient in the global namespace.As such, you simply need to prefix any object creation calls with this module. For instance

const room = new LivekitClient.Room();

to create a room.

like image 186
Nick Avatar answered Dec 19 '25 21:12

Nick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!