emailjs / emailjs-imap-client

Low-level JS IMAP client for all your IMAP needs.
MIT License
553 stars 122 forks source link

Integration with React Native #200

Closed JavaDumb closed 5 years ago

JavaDumb commented 5 years ago

Hello, I am trying to use this library within React Native. Using the import of 'emailjs-imap-client' within the application throws error: Error: Unable to resolve module net from <Directory>/ReactNative/Testing/Login/node_modules/emailjs-tcp-socket/dist/node-socket.js: Module net does not exist in the Haste module map

Question:

  1. Is it possible to use the package in React Native? I assume technically it should be possible
  2. How can I get rid of this error?

Thanks

DamageESP commented 5 years ago

Hi,

You're trying to use Node.js libraries (in this case, net) in a "browser" environment. That is not possible.

You could create the front-end with React Native, and then create an API in Node.js that uses this library and call it from your front-end. So answering your questions:

  1. Not with React Native so to speak, but you can create an API and call it from React Native, yes.
  2. Separating front-end and back-end.