-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
requiring npm modules fails #375
Comments
For this specific case you'll likely want to use the |
Yeah, had a major "doh" moment after posting. But superagent and most browser friendly modules should work, no? |
Summary: Apparently we promote using superagent but it doesn't actually work. See issues facebook#370 facebook#10 facebook#375 The main issue stopping it from working is the `browser` field in package.json which both browserify and webpack implments. This implements most of the spec found here https://gist.github.com/defunctzombie/4339901 The only thing we're not implementing is the `module-name: false` part to ignore a module because it doesn't seem to be as used. If someone complains about it we'll implement it then. Test Plan: ./runJestTests.sh * npm install superagent in JS * test using superagent
What? Isn't it supoorted to use ordinary npm modules in a react native project by simply npm installing. |
It is, but not the ones that rely on a node runtime environment. |
Huh! Thanks, I am really relaxed, serious. |
What was the problem when you were installing superagent or request? |
Was this resolved? |
@markthethomas then how do i use other modules like lodash or xml2js? |
@isikfsc The problem when I installed |
Was hoping to try out using something like request or superagent (as suggested in docs) to handle network calls, but when I
npm install -S
them, I getrequiring unknown module [MODULE_NAME]
for both superagent and request. Could it be that the deps for eachrequire
d module aren't being recursively looked at? Is this expected behavior And, furthermore, is there a best way to go aboutrequiring
modules for React-Native specifically that would differ from a more straightforward/typical JS use-case?example thrown error for
require('request')
or related npm modulesThe text was updated successfully, but these errors were encountered: