AidanWelch / google-translate-api

An updated free and unlimited API for Google Translate :dollar: :no_entry_sign:
MIT License
143 stars 20 forks source link

Can't run on React.js #34

Closed muhAzis closed 1 year ago

muhAzis commented 1 year ago

The error: TypeError: google_translate_api_x__WEBPACK_IMPORTED_MODULE_1__ is not a function

I've tried using this library on vanilla js and it works just fine. But when I tried it on React it keeps getting error like in the above even I use the simpliest method to use this library. Is there any settings that I have to apply first in my React project before using this library? Sorry for my english and I'm new to React and JavaScript, so it will be so kind of you if you can give me an assistance.

Btw, thanks for providing this library

AidanWelch commented 1 year ago

This library isn't compatible with web react, generally, because of CORS. But that shouldn't make this error. What version of this package are you using? Also, what version of node are you using? And, can you post your babel configuration?

AidanWelch commented 1 year ago

Inactive