I’ve tried to find advice on this but cannot see anything so thought I would ask, please direct me to the relevant place if this info already exists.
What is the “best practice” environment setup to work with the extension? Mac? Linux? Windows? Do you guys use VS Code or some other editor?
I’m looking to do some work with the extension on Windows 11, so have forked the GitHub repo, followed the guidance and got as far as installing my build of the extension in Chrome but then I get a load of errors. A friend of mine, trying to do the same thing on a Mac, doesn’t get the errors. So before I make the switch I wanted to see if there is any advice what to use.
Front end app that interacts with MetaMask is one of the things yes, but I was also trying to see if I can make changes to the actual MetaMask extension itself for some custom behaviour, if it’s even possible.
And this is what I’m struggling with, to even get it to work with yarn start where I am able to run it locally without errors.
I have found references to this error in MetaMask GitHub > Issues and they go back few months without a fix. There was a workaround suggested but it doesn’t seem to work with the latest v18 of the extension, especially because the code where the workaround needs to be applied has completely changed now.
I am using nvm and using version 16.14.2 of node, I installed yarn, then run yarn setup and when that finished I did yarn start.
What do you do your development in? Mac? I’m assuming you’ve worked on the extension project, correct me if I’m wrong.
Yeah from my understanding this isnt an issue on macOS, I’d imagine the GitHub issues page would be full of people complaining about it. But at least you’ve answered one thing, people working on this extension tend to use a Mac so that’s helped.
I’ll keep looking into this and trying different versions of node, etc. I might have tried 14.15.0 already but can’t remember, I’ve tried a few.
Thank you for that info, I did see the Flask thing but wasn’t sure if it’s what I needed. Now that I’ve read some more about it, I’m going to give it a go.
Regarding the different environments, are you aware of any of the MetaMask devs also having this issue that I and by the looks of it many others are having, with the LavaPack is not defined error. Is this even the place to discuss this kind of problem or should I be raising a GitHub issue?
I was going to raise an issue but it looks like there are 5 open issues about it already, going back to Mar 29 2021. I’ll link them below (I can only post issue numbers, can’t do links). The latest one says it’s happening with MetaMask v10.17.0 but I can confirm it also happens with v10.18.0
So the more I looked into it all the more I was convinced that trying to develop the extension on Windows was a bad idea. I cloned the code base into my Ubuntu WSL, installed NVM and followed the dev setup steps from the README and boom, it works!
Clearly there is something wrong with the whole yarn setup process on Windows, maybe its to do with the fact all the files are LF and not CRLF and something is getting messed up? I don’t know, just a wild guess.
So I’m happy to close this ticket and hopefully others might find it useful.