react dependency

Trying to use a front end kit which requires react 18. Dependency tree cannot be resolved since wasp defines react version as 17. Any hints at how to resolve? The front end kit would be really useful
11 Replies
entjustdoit
entjustdoit12mo ago
Don’t see how I could use —legacy-peer-deps since wasp handles the npm install
martinsos
martinsos12mo ago
Hey entjustdoit! Bad news: Ah that is tricky -> yeah, currently you can't. Good news: we will be releasing the new Wasp version, with upgrade to React 18, in approx 14 days! Better news: we are also working on some bigger changes to Wasp that might allow options like --legacy-peer-deps in the future -> but that will be coming in a couple of months most likely. Btw which front end kit is it, I am interested? Oh one idea: I think there is a way to define some npm flags globally, per whole machine. Maybe you could do that, and Wasp should probably pick that up then, when running the npm command. But I wonder if it will all work ok for you then, Waps is still using React 17 and this library probably won't work with it then?
entjustdoit
entjustdoit12mo ago
Update: had the same idea about forcing the flag globally and turns out it just didn’t work with peer deps - oh well. It’s livekit - adding video conferencing to the second app I am building. I will probably still use their api will just have to do a custom front end which is way more work than their default
martinsos
martinsos12mo ago
Hm that sucks. Is 14 days too long for you to wait? Do they possibly have an older version that is react 17 compatible?
entjustdoit
entjustdoit12mo ago
Didn’t find an older version that was compatible. Onboarding an initial cohort of users within the next few days so probably too long to wait, but knowing that it’s 14 days away will probably build a much more slimmed down video conferencing UI until then (ie just video views, and a microphone and leave call button).
martinsos
martinsos12mo ago
Got it! We can try to get it out even sooner - but we wanted to make sure we test it properly. What we can try to do is get something out sooner, for example Monday/Tuesday, and release a test version of Wasp that uses it, that you can download and use. Wouldn't be super well tested, but should probably be fine. Which version of Wasp are you using for this app?
entjustdoit
entjustdoit12mo ago
No rush on launching. I think as a contingency I’ll have to build the slimmed down UI anyway. 0.10.6 for this (and amicus too)
martinsos
martinsos12mo ago
Ok great - I will ping you if we have anything out sooner! @entjustdoit I created a version of wasp 0.10.6 that has React 18. I am building it now and I believe it should pass the CI/CD soon -> When that is done, you can try using that one instead of your "normal" 0.10.6 version you are using right now! So basically it is the same as version you have right now, with the only change that React 17 got updated to 18, + neccessary changes to get that working (upgraded some other libraries, vite and some configs a bit). I tested it somewhat with our example apps and it seems to run fine, but I can't guarantee 100% there are no issues. This is more as a temporary solution for you until we release new version of Wasp in two weeks. Once it builds I will let you know the instructions on how to install it. Ok @entjustdoit , here it is! To install it, do
curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.10.6-react18-canary
curl -sSL https://get.wasp-lang.dev/installer.sh | sh -s -- -v 0.10.6-react18-canary
That should be it -> if you do wasp version, it will still return 0.10.6 so don't be surprised about that. But it will now be using React 18, not 17.
entjustdoit
entjustdoit12mo ago
Just gave it a go and it seems to be working pretty well 🙏 Thank you so much!
martinsos
martinsos12mo ago
Awesome, and if you find any issues let us know
entjustdoit
entjustdoit12mo ago
Will do!