matheuss / google-translate-api

A free and unlimited API for Google Translate :dollar::no_entry_sign:
https://npmjs.com/package/google-translate-api
MIT License
2.91k stars 608 forks source link

TypeError: Cannot read property 'toString' of undefined #89

Open merrysabreezy opened 5 years ago

merrysabreezy commented 5 years ago

screenshot 162 screenshot 163

How to solve this problem in react-native?

gabrii commented 5 years ago

Same problem here, but with react js 16.7.0, and on import.

rawr51919 commented 5 years ago

This isn't actually an issue of this repo. It's an issue related to you using "" instead of '' where you're using it.

dallashuggins commented 5 years ago

I am receiving the exact same error and I'm not using double quotes @coltongit.

return translate('Test', {from: 'en', to: 'fr'}).then(res => {
      return res.text;
    }).catch(err => {
      console.error(err);
    });
SallyHabib97 commented 5 years ago

I am receiving the exact error while using one quote

vitalets commented 5 years ago

This library does not work in web page context. See: https://github.com/vitalets/google-translate-api#does-it-work-from-web-page-context