Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native assetPath.replaceAll() is not a function

I keep getting this error. My app has been working perfectly for days but I was having some trouble with env files so I did a complete reinstall and cleaned my cache. Now whenever I try to build the app I get this error:

src\images\avatar.jpg: assetUrlPath.replaceAll is not a function

This isn't just happening with images either, I also ran into this error with my fonts:

node_modules\@expo-google-fonts\montserrat\Montserrat_400Regular.ttf: assetUrlPath.replaceAll is not a function

I have removed node_modules, deleted the package-lock.json, cleared my cache again, reinstalled, reinstalled expo, and nothing.

What's more when you put the error into google you get zero results for react-native. What am I doing incorrectly?

like image 637
KAT Avatar asked Sep 11 '26 20:09

KAT


1 Answers

Answering this just in case someone runs across this error. I am using nvm and forgot that my node version was set to 14. Setting to 18 fixed the issue.

like image 199
KAT Avatar answered Sep 15 '26 11:09

KAT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!