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

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

Closed
gitim opened this issue Aug 22, 2016 · 8 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@gitim
Copy link
Contributor

gitim commented Aug 22, 2016

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 #2208, facebookarchive/node-haste#77, https://github.com/facebook/node-haste/issues/62 related to my issue.

@jgkim
Copy link

jgkim commented Aug 25, 2016

Same here. Is there any workaround?

@gitim
Copy link
Contributor Author

gitim commented Aug 25, 2016

Same here. Is there any workaround?

I can see the only workaround is to fork a dependency and remove browser field from its package.json or wrap the require in the fork with try/catch.

@jgkim
Copy link

jgkim commented Aug 25, 2016

@gitim Thanks for the answer. However, I'm using react-intl, which depends on intl-messageformat, and react-intl itself has also the same issue. :(

ghost pushed a commit that referenced this issue Sep 16, 2016
Summary:
This adds support for `false` values in `package.json` `"browser"` and `"react-native"` mappings.
All `false` values are not longer silently ignored, but redirected to an empty file.

Fixes #9854 #9518

Reviewed By: bestander

Differential Revision: D3876521

fbshipit-source-id: 96d1ba03518812bc88c51672c374956eabd40c9b
@davidaurelio
Copy link
Contributor

davidaurelio commented Sep 16, 2016

Fixed with 5710b23

@gitim
Copy link
Contributor Author

gitim commented Sep 16, 2016

@davidaurelio cool, thanks!

mikelambert pushed a commit to mikelambert/react-native that referenced this issue Sep 19, 2016
Summary:
This adds support for `false` values in `package.json` `"browser"` and `"react-native"` mappings.
All `false` values are not longer silently ignored, but redirected to an empty file.

Fixes facebook#9854 facebook#9518

Reviewed By: bestander

Differential Revision: D3876521

fbshipit-source-id: 96d1ba03518812bc88c51672c374956eabd40c9b
@lukescott
Copy link

@davidaurelio I see that commit is supposed to be on 0.35.0-rc.0.

This is what I have in my package.json:

   "browser": { "crypto": false },
   "react-native": { "crypto": false }

But I get this:

screen shot 2016-09-30 at 4 22 09 pm

I've tried all the suggestions for clearing cache and reinstalling npm modules. Can't get it to work.

What am I doing wrong here?

cykler pushed a commit to NewStore/react-native that referenced this issue Oct 11, 2016
Summary:
This adds support for `false` values in `package.json` `"browser"` and `"react-native"` mappings.
All `false` values are not longer silently ignored, but redirected to an empty file.

Fixes facebook#9854 facebook#9518

Reviewed By: bestander

Differential Revision: D3876521

fbshipit-source-id: 96d1ba03518812bc88c51672c374956eabd40c9b
@davidaurelio
Copy link
Contributor

@lukescott this might be due to a long standing bug in our browser field logic :-( sorry about that

berrytj pushed a commit to mdcollab/react-native that referenced this issue Feb 1, 2017
Summary:
This adds support for `false` values in `package.json` `"browser"` and `"react-native"` mappings.
All `false` values are not longer silently ignored, but redirected to an empty file.

Fixes facebook#9854 facebook#9518

Reviewed By: bestander

Differential Revision: D3876521

fbshipit-source-id: 96d1ba03518812bc88c51672c374956eabd40c9b
@adarshTS
Copy link

adarshTS commented 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

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants