Requiring unknown module "./locale/en_GB"

#1

I’m getting the above error when running a published app through the Expo client. It only happens on Android, and it doesn’t happen for apps served/tunnelled from my laptop.

It seems to be down to this:

    var deviceLocale = await Util.getCurrentLocaleAsync();
    moment.locale(deviceLocale);

I’ve imported momentjs as follows:
var moment = require("moment/min/moment-with-locales");

Do I need to do something special to package up the en_GB file for Android and published apps, not for local development?

#2

The dependency graph of modules should be the same whether you published or not. This is a stretch but make sure you’re not using the Chrome debugger when testing this – the debugger changes the environment in which your code runs. You could also try creating a small simple app with just those lines of code in a component to see if you can isolate the problem.