react-moralis
react-moralis copied to clipboard
Vite + React encountered Uncaught TypeError: Super expression must either be null or a function
Hi, i’m encountered this error when using Vite + React Moralis. This error is not happening when using webpack (npx create-react-app) and only occured when using vite.
main.jsx:
Error:
We have seen several issues with Vite apps. It might be because of the way they handle EsModules.
It might be solvable by configuring the app, but my knowledge of Vite is limiting unfortunately.
We will look into better out-of-the-box support for Vite apps, or provide boilerplate for it in the future
A quick way to fix this is by adding events
as a dev dependency by running yarn add -D events
or npm i --save-dev events
and that should get that fixed.
@Qudusayo Thanks mate! I had the same issue and your solution magically solved it.
A quick way to fix this is by adding
events
as a dev dependency by runningyarn add -D events
ornpm i --save-dev events
and that should get that fixed.
Thank you @Qudusayo, this issue made me scratch my head a bit😂, and hopefully they could fix this issue soon