Uncaught Error: Requiring unknown module './locale/America/New_York'

#1

We’re using moment-timezone in our app to handle dates & timezone conversions. When I run the app on the iOS simulator, it runs fine. If I scan the QR code on my local machine to run the app through the Expo app on Android, it runs fine. However, when I publish the build to Expo, and scan on the Expo website, the app crashes on Android, complaining that it can’t find the locale file for my timezone (which happens to be America/New_York).

I don’t see any timezone locale files in moment-timezone, other than the latest.json data file.

It would seem there is a locale file that isn’t getting packaged with the Expo build. Anyone using moment-timezone effectively?

0 Likes

#2

Updating the version of moment in package.json to: “moment”: “2.18.1”…fixed it. I think we were including moment 2.9.0

1 Like

#3

Glad you got to the bottom of it! Thanks for posting the solution.

Cheers,

Adam

0 Likes

closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

0 Likes