Since this project uses Preact, it is necesary to add the following code to your vite.config.ts to ensure compatibility if your project relies on React
vite.config.ts
Detailed documenation on aliasing React to Preact can be found here
import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; // https://vite.dev/config/ export default defineConfig({ plugins: [react()], resolve: { alias: { react: 'preact/compat', 'react-dom': 'preact/compat', }, }, });