1

QUICK FIX: 'React is not defined' error on self-hosted web players

If you are playing around with self-hosting an open-source web IPTV player (like the popular React-IPTV template) and you get a blank white screen with `ReferenceError: React is not defined` in the console, here is the fix. You updated Vite recently but your codebase is still using the old JSX transform. In your `vite.config.ts`, you need to explicitly tell the React plugin to use the classic runtime if you don't want to import React manually everywhere. Change: `plugins: [react()]` To: ```javascript plugins: [react({ jsxRuntime: 'classic' })] ``` Restart your dev server. Fixed.
3 Comments

Comment as Guest

HomeRooms
Log In
ChatProfile