reactour icon indicating copy to clipboard operation
reactour copied to clipboard

Uncaught ReferenceError: React is not defined in production build using vite

Open robiokidenis opened this issue 1 year ago • 6 comments

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(),
    ],
    
});

robiokidenis avatar Oct 27 '22 14:10 robiokidenis