question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Packager] "Requiring unknown module" error for module from package.json browser field

See original GitHub issue

Hi! After upgrading to the react-native@0.32 I am getting 2016-08-22 10 55 59

in my project I am using https://github.com/yahoo/intl-messageformat, which has browser field in its package.json https://github.com/yahoo/intl-messageformat/blob/master/package.json#L31-L34, and while trying to require ./lib/locales it fails. Seems these https://github.com/facebook/react-native/pull/2208, https://github.com/facebook/node-haste/pull/77, https://github.com/facebook/node-haste/issues/62 related to my issue.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
davidaureliocommented, Sep 16, 2016

Fixed with 5710b230a2a0f2b29553fbf94af5147a2e030f44

0reactions
adarshTScommented, Aug 4, 2017

@gitim @davidaurelio how did u fix this? I have the same error 2nd-error

when I did a few corrections it shifter from module 3 to 4 in the same error

I tried this "browser": { "crypto": false }, "react-native": { "crypto": false } in my package.json but didnt work

Read more comments on GitHub >

github_iconTop Results From Across the Web

Requiring unknown module react-native - Stack Overflow
It sounds like you are missing the node_modules folder from your react native project directory. First steps are to check: Is the node_modules ......
Read more >
@rollup/plugin-node-resolve - npm
A Rollup plugin which locates modules using the Node resolution ... of the package.json exports field to match when resolving modules.
Read more >
Package exports - webpack
When the exports field is specified, only these module requests are available. Any other requests will lead to a ModuleNotFound Error.
Read more >
Troubleshooting | React Navigation
If the module points to an npm package (i.e. the name of the module doesn't with ./ ), then it's probably due to...
Read more >
rollup.js
Importing CommonJS · Publishing ES Modules ... If your package.json file also has a module field, ES-module-aware tools like Rollup and webpack 2+...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found