Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo encountered a fatal error: Error: Requiring unknown module "./locale/en-us"

I had to eject my Expo project last week, and I though everything was working fine (dev version).

I'm now testing on an actual device with a build (apk) and it crashes at boot. I used adb logcat for my device to print out the error and got this :

Requiring unknown module "./locale/en-US".
ReactNativeJS: Error: Requiring unknown module "./locale/en-us".
WARNING: getPackageName called on ScopedContext
WebViewFactory: Loading com.google.android.webview version 86.0.4240.198 (code 424019833)
AndroidRuntime: Shutting down VM
AndroidRuntime: FATAL EXCEPTION: main
AndroidRuntime: Process PID: 21039
AndroidRuntime: java.lang.RuntimeException: Expo encountered a fatal error: Error: Requiring unknown module "./locale/en-us"., stack:
AndroidRuntime: v@2:1305
AndroidRuntime: d@2:875
AndroidRuntime: vt@1203:16827
AndroidRuntime: pt@1203:16651
AndroidRuntime: kt@1203:16926
AndroidRuntime: I@694:2048
AndroidRuntime: _r@103:40603

I looked on StackOverflow and Google and it seems to be linked to the way moment requires locales. I tried every solutions I could find without any luck.

Anyone has an idea ? Thank in advance!

like image 448
Sylvain Vandevelde Avatar asked Sep 16 '25 14:09

Sylvain Vandevelde


1 Answers

If you are using moment then the reason for that is moment.locale('en-US') not recognized, you need to use moment.locale('en') instead.

like image 186
electroid Avatar answered Sep 19 '25 08:09

electroid