Closed SarkarKurdish closed 3 years ago
Any error information? I tried and got the result,
{
text: 'hello',
userLang: 'auto-detect',
translation: 'مرحبًا',
language: { from: 'en', to: 'ar', score: 1 },
correctedText: ''
}
Sorry for missing the title. It seems you are connecting to 127.0.0.1
. The resolved IP by DNS looks incorrect.
I didn't change anything and i dont remember changing anything related to DNS or other stuff so,i did a little search looks like people had same issue with got
and http-proxy-agent
so what I'm suppose to do?
So is your program running behind a proxy? If not, can you access the official website https://bing.com/translator? If neither, I'm afraid it's because your ISP has a limit for the bing website. Maybe you could try to modify your Windows/Mac's host file to specify the IP of bing.com
manually.
I can go to bing.com normally and do translations and I don't have any proxy turned on and i tried to set the ip manually it didn't work
It seems some other libraries (for example, node-agent-base) patched the core NodeJS method. Please check if this library is required somewhere and try to upgrade related dependencies. See sindresorhus/got#951
Thanks that was the issue http-proxy-agent was already installed and some how made this error happen after changing to new project the problem solved.
Can't translate anything getting this error when using the main function
translate('hello', null, 'ar', true).then(res => { console.log(res.translation); }).catch(err => { console.error(err); });