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 production build error: TypeError: Right-hand side of 'instanceof' is not callable #228
Comments
Im encountered ther similar issue. Have you solved this issue? |
I was able to get get around the issue by loading Moralis via CDN Yeah it works in prod. |
Which means you are no-longer using MoralisProvider with react-moralis? |
Yeah. You will have to initialize with |
If it worked on local dev, but not in production, then I assume it might have something to do with the build process.. We did have several issues with Vite apps in the past, and some custom configuration might be needed. Better out-of-the-box support for Vite apps is on the roadmap. Do you have an error log with non-minimized code, to see where it is coming from? |
I like your suggestion. But there's a |
Got it working. Had to do
|
Glad it's working now @fahmidme |
@ErnoW This issue only comes up after build and the build process doesn't error out. |
Hi all, any updates on this? I'm trying to use the workaround, and I'm importing using Currently getting this error AFTER the build: Using the app pre-build works just fine, the build is the problem. I'm on a vite app. Any way you can suggest a fix for the react-moralis side of things @Xavier-Charles? Any help would be appreciated. I'm happy to provide more insight. |
Hi @georgeportillo, I think this error comes up because you are still importing react-moralis somewhere in your code base. remove react-moralis with |
Hi, any fixes update for the vite yet? |
Hi. Looks like there hasn't been any updates on this topic for more than a month since it was opened almost 3 months ago. Are there any fixes planned for this in the future? Or will we have to use the workaround proposed or go back to CRA? |
I just hit this tonight after two weeks happily going about my business in dev with Vite & React. 🤦🏻 Comforted to see others in the same boat - I thought it was my shonky code. 😄 |
is there anyone get over it yet? |
This is the non-minimized code, is there any idea on it? @ErnoW |
Ummmm that's strange I just have the same issue after updating to the newest moralis library(with the v1) today. I think it's the problem of uninstalling moralis? cuz it seems like these's some |
Facing a similar issue in React-ts app Has anyone found a better solution instead of removing react-moralis @ErnoW ? |
This issue still persists in the latest version as of now @1.4.x . The workaround was to fall back to a previous version @1.3.5 to make it work. Please fix the issue in the upcoming release so everyone can be at ease. |
I had the same issue and following this resolved it for me. |
Still have this issue :/ |
Then we can't even use hooks and stuff. So there's no point in using react-moralis, instead we can do just native js implementation in React app and that's what is working for me too.. |
Try add this to your vite config:
|
I've got a basic Vite + React-TS template. Then added the codes found from Connect with React.
Initially it didn't work throwing some error on local dev. After a quick google I added @walletconnect/web3-provider which fixes the issue. Metamask login works on local dev.
I then proceeded to build it and deploy. When loading the deployed website, console shows the error:
main.tsx
App.tsx
The text was updated successfully, but these errors were encountered: