reactour
reactour copied to clipboard
Uncaught ReferenceError: React is not defined in production build using vite
I get an Uncaught ReferenceError: React is not defined error
. This error happens only in production build and not in the dev server.
here is my vite.config.js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [
laravel({
input: 'resources/js/app.jsx',
refresh: true,
}),
react(),
],
});