use-metamask icon indicating copy to clipboard operation
use-metamask copied to clipboard

Missing dependency when build with vite

Open nicolasdanelon opened this issue 2 years ago • 0 comments

I'm building a website with the latest version of [email protected] and [email protected].

I'm seeing the following error: Uncaught ReferenceError: regeneratorRuntime is not defined

this is the line 93: Uncaught ReferenceError: regeneratorRuntime is not defined - regeneratorRuntime.mark(function _callee(Web3Interface)

after a little bit of googling I saw that create-react-app has somewhere this package: regenerator runtime since I'm not using creat-react-app I don't have that package.

I don't know why, but on Firefox sometimes the website works... and sometimes it doesn't.

All my code works fine if I try create-react-app, but with vite it does not. I can create a stackblitz if you please, just let me know.

I fix this bug adding regenerator runtime to my website. even if I'm not using it I just import it on my entry point and eventing works fine.

Cheers! 🍻

nicolasdanelon avatar Jun 21 '22 05:06 nicolasdanelon