Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReactNativeJS: Requiring unknown module "./locale/en-US" on release build #16540

Closed
6be709c0 opened this issue Oct 25, 2017 · 4 comments
Closed
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@6be709c0
Copy link

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: Linux 4.10
Node: 6.10.3
Yarn: 0.24.4
npm: 3.10.10
Watchman: Not Found
Xcode: Not Found
Android Studio: Not Found (I'm using docker)

Packages: (wanted => installed)
react-native: 0.48.4 => 0.48.4

My error

I am using I18n to translate the app, but I have the following error only when I build the assets :
(I don't know if the error is due to I18n)

0-26 09:56:58.545 19105 19161 E ReactNativeJS: Requiring unknown module "./locale/en-US".
10-26 09:56:58.552 19105 19161 E ReactNativeJS: Requiring unknown module "./locale/en-us".
10-26 09:56:58.561 19105 19162 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
10-26 09:56:58.561 19105 19162 E AndroidRuntime: Process: com.nelio, PID: 19105
10-26 09:56:58.561 19105 19162 E AndroidRuntime: com.facebook.react.common.JavascriptException: Requiring unknown module "./locale/en-US"., stack:
10-26 09:56:58.561 19105 19162 E AndroidRuntime: o@2:783
10-26 09:56:58.561 19105 19162 E AndroidRuntime: n@2:426
...

My steps :

m -rf node_modules
yarn install
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
react-native run-android --variant=release

And the app crash when I launched it. Not in debug mode.
Do you have any idea how to add this module ? Manually or automatically ?

@suciptoid
Copy link

suciptoid commented Nov 20, 2017

Do you use momentjs?

Related to this issue
moment/moment#3624 (comment)
#1629 (comment)

@kyo504
Copy link
Contributor

kyo504 commented Nov 20, 2017

I had the same problem after updating moment-related packages.

moment : 2.19.1 => 2.19.2
moment-timezone : 0.5.13 => 0.5.14
I don't know what the problem is exactly but after downgrading versions it works fine. Hope this helps you.

@stale
Copy link

stale bot commented Jan 19, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 19, 2018
@stale stale bot closed this as completed Jan 26, 2018
@JanithaR
Copy link

I don't understand what am I suppose to do to fix this. Should I be adding import 'moment/locale/en-us'; ? I only see

en-au, en-ca, en-gb, en-ie, en-nz

in the locale folder.

@facebook facebook locked and limited conversation to collaborators May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

4 participants