'Build is not working in react using vite bundler
Solution 1:[1]
the problem was with a react library called react-custom-scrollbars
Solution 2:[2]
You need to use this config, (take a look at @vitejs/plugin-react which you probably need to install)
vite.config.js:
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
export default ({ mode }) => {
return defineConfig({
plugins: [
react(),
],
});
};
The thing is that vite does not import React by default into jsx components, so you need to do it manually in every component or use this plugin.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Revan99 |
| Solution 2 | valerii15298 |

