Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite + React encountered Uncaught TypeError: Super expression must either be null or a function #229

Open
weeliem opened this issue Apr 5, 2022 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@weeliem
Copy link

weeliem commented Apr 5, 2022

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:
image

Error:
image

@ErnoW
Copy link
Member

ErnoW commented Apr 13, 2022

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

@ErnoW ErnoW added the help wanted Extra attention is needed label Apr 13, 2022
@Qudusayo
Copy link

Qudusayo commented Apr 14, 2022

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.

@masafumimori
Copy link

@Qudusayo Thanks mate! I had the same issue and your solution magically solved it.

@MyNameIsTakenOMG
Copy link

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.

Thank you @Qudusayo, this issue made me scratch my head a bit😂, and hopefully they could fix this issue soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants