Requiring unknown module "./lang/en"
See original GitHub issueI’m trying to use this package in react-native, but unfortunately requiring the module results in the following error:
Requiring unknown module "./lang/en". If you are sure the module is there, try restarting the packager.
Is this something specific to the fact that I’m using react-native, or am I making a rookie mistake here? Any input would be appreciated.
Issue Analytics
- State:
- Created 8 years ago
- Comments:10
Top Results From Across the Web
Unhandled JS Exception: Requiring unknown module "104"
Getting error Unhandled JS Exception: Requiring unknown module "104". If you are sure the module exists, try restarting Metro.
Read more >Error: Requiring unknown module '789' · Issue #3590 - GitHub
Error: Requiring unknown module "789". If you are sure the module exists, try restarting Metro. You may also want to run yarn or...
Read more >I got this error message "Requiring unknown module "ws""
I got this error message "Requiring unknown module "ws"". Nicolas Charpentier. Moved from https://github.com/facebook/react-native/issues/9559.
Read more >Requiring unknown Module "1171" React Native Error Fix
I faced one such react native error recently. It says Requiring unknown module “1171”. If you are sure the module is there, try...
Read more >Requiring unknown module "498" error in ReactNative getting ...
I had the same issue. In my case, while creating a reusable component, I wasn't importing React into the file,as I was not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The fix for @danieloprado didn’t quite work for me - I adapted it to this, which I include in my root component (i.e. this is a global change).
A year later I ran into the same issue. The current stand is that the react native packager still doesn’t support dynamic require. So if you have the same issue you’ll have to change
var rawMessages = require('./lang/en');
if you need support for all the languages, the nyou’ll have to define each language and based on the value require it. Something like this
var langs = { en : ‘.langs/en’, de : ‘.langs/de’ }
Stupid, but that’s the way it works…