angelos3lex / react-native-smtp-mailer

Send emails by connecting to smtp server+attachments, using android javamail and ios mailcore2
39 stars 32 forks source link

RNSmtpMailer is null #30

Closed r0adrunner closed 3 years ago

r0adrunner commented 4 years ago
angelos3lex commented 4 years ago

Hey @r0adrunner did you find any solution? Otherwise, i will have some time this Sunday to check it

r0adrunner commented 4 years ago

Hi @angelos3lex

Just realized the example I gave does not satisfy

"peerDependencies": {
    "react-native": "^0.41.2"
  }

in package.json Maybe it's that. But didn't find any client solution, for the moment I'm going with a server solution.

But maybe a feature request, make it work with the latest react-native?

josmmv commented 4 years ago

I got this error message when import react-native-smtp-mailer: Could not find a declaration file for module 'react-native-smtp-mailer'. 'c:/Users/.../node_modules/react-native-smtp-mailer/index.js' implicitly has an 'any' type. Try 'npm install @types/react-native-smtp-mailer' if it exists or add a new declaration (.d.ts) file containing 'declare module 'react-native-smtp-mailer';'

Juman8 commented 4 years ago

ok. i found a solution is edit link this lib in Podfile. pod 'RNSmtpMailer', :path => '../node_modules/react-native-smtp-mailer/ios' instead of the original is pod 'RNSmtpMailer', :path => '../node_modules/react-native-smtp-mailer

It seems that the problem with the location of the podspec file path causes ios to be unable to get the link and unable to get resources

angelos3lex commented 4 years ago

I got this error message when import react-native-smtp-mailer: Could not find a declaration file for module 'react-native-smtp-mailer'. 'c:/Users/.../node_modules/react-native-smtp-mailer/index.js' implicitly has an 'any' type. Try 'npm install @types/react-native-smtp-mailer' if it exists or add a new declaration (.d.ts) file containing 'declare module 'react-native-smtp-mailer';'

This is because this module has no definition file yet.

ok. i found a solution is edit link this lib in Podfile. pod 'RNSmtpMailer', :path => '../node_modules/react-native-smtp-mailer/ios' instead of the original is pod 'RNSmtpMailer', :path => '../node_modules/react-native-smtp-mailer

It seems that the problem with the location of the podspec file path causes ios to be unable to get the link and unable to get resources

nice catch!

r0adrunner commented 4 years ago

The bug report says it does not work in android emulator The solutions posted by Thanhcao86 seem to be related to ios. The problem posted by JosMMV seems unrelated to original error

Why is this closed?

josmmv commented 4 years ago

The problem posted by JosMMV seems unrelated to original error

I got the original error too, but additionally, the console returns the error message that I posted.

BepaTest commented 3 years ago

Hello, I have the same issue working on Android emulator. I did automated linking and checked manual as well, but still have null. Please help.

angelos3lex commented 3 years ago

@r0adrunner This seems an issue after ejecting an expo project, as by using it in a new project initiated with react-native-cli on latest version works flawlessly. Since i reproduced, the way i managed to resolve the issue was by the following steps:

Then the imported module is no longer null. Not sure what helped. Probably the npm i command, as the expo used yarn by default and as i can see there was a bad synchronization between them, making this module not visible for link, and the manual link was not working as well. It's not advised to use both in an app anyway, just one of them. Please close the issue if this fixes it for u

BepaTest commented 3 years ago

@angelos3lex Thank you for your reply. My project wasn't expo at the beginning so I didn't do ejection. However react-native-smtp-mailer worked for me when I updated react-native version. Next step is to make attached pictures working :)

angelos3lex commented 3 years ago

@BepaTest are you referring to #29?

BepaTest commented 3 years ago

@angelos3lex

30 is resolved for me by updating react-native version

29 will be my next step