-
Notifications
You must be signed in to change notification settings - Fork 252
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
Support for react-native #132
Comments
Same here |
I don't have much time to maintain this library, and I am completely unfamiliar with react-native. If somebody submits a pull request with a fix I'll consider handing out commit and release access so they can fix and release this themselves. |
Thanks for fast respond aslak. Since I'm working on another project that takes much time from me, I can't help you on that but I hope you leave this issue open to let someone refer & submit a pull request. You can use tags like ( help needed & ... ) too. |
I'm curious if the new version ( |
Hi,
I think it is so painful that such a useful module can't be implemented in react-native.
What I did:
I made a blank project with react native and used the module just like every other api:
then there was below error.
error: bundling failed: Error: Unable to resolve module urlfromnode_modules\eventsource\lib\eventsource.js: url could not be found within the project.
I also tried using compiled polyfill or compiling with browserify but another error appeared:
Possible Solution
the error when I use your module (not the polyfill) & errors after that was solved after I installed 'url' & other modules like 'http' & 'https' .
then in the bundler I saw below error just as I expected since react-native don't support node core modules due to difference between binary files.
error: bundling failed: Error: While trying to resolve module httpsfrom file\node_modules\eventsource\lib\eventsource.js, the package \node_modules\https\package.jsonwas successfully found. However, this package itself specifies amain module field that could not be resolved (\node_modules\https\index.js)
In the link below I found a way to compile required http, https, base64-js, buffer, ieee754 modules that are available in the node core modules.
After that the http module compiled file with browserify required a file named './decode' and some other files that I couldn't found.
To Reproduce
Just build a react-native project & copy the code into it.
The text was updated successfully, but these errors were encountered: