imlinhanchao / vsc-google-translate

A Translate Extension for VSCode
https://marketplace.visualstudio.com/items?itemName=hancel.google-translate
MIT License
108 stars 17 forks source link

Translate failed, please check your network. #3

Closed czd890 closed 4 years ago

czd890 commented 4 years ago

本地网络没有问题,浏览器打开https://translate.google.cn/,响应速度很快。

imlinhanchao commented 4 years ago

请协助提供翻译的文本。

imlinhanchao commented 4 years ago

刚刚更新了一个版本,加入内部错误的详细信息,请再帮忙试试并提供错误资讯。

czd890 commented 4 years ago

Translate failed, Error message: "The "listener" argument must be of type Function. Received type object". Please post an issues for me.

imlinhanchao commented 4 years ago

em,这个错误信息还真是奇怪,唯一的listener参数就只有https模块的 Response 事件监听。但是确确实实是传入的函数没错。你的 VSCode 版本是多少,是最新版吗?

imlinhanchao commented 4 years ago

我似乎找到问题了,似乎是Node 8 与 Node 10 差异的兼容性 Bug。但我这边没有办法验证。你可以帮忙试试吗? google-translate-0.0.9.zip 先卸载商店安装的插件,然后下载这个插件安装包。解压后选中左上角 ... 从 VSIX 安装。看看是否还有问题。 image

czd890 commented 4 years ago

vs version info:

版本: 1.40.1 (user setup)
提交: 8795a9889db74563ddd43eb0a897a2384129a619
日期: 2019-11-13T16:49:35.976Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.14393

下载你给我的包安装的

image

1.0.7 表示OK

image

imlinhanchao commented 4 years ago

好的,了解了,1.0.8开始为了减少包大小,没有用 request 库区做网络请求,改成用 https 自己实现。这样看似乎容易有兼容性问题。

czd890 commented 4 years ago

NB,你这个响应速度吊炸天了!

imlinhanchao commented 4 years ago

哈哈,因为日常摸鱼刷 GitHub,我晚上换一个轻量级的请求库再打包一版给你试试。

imlinhanchao commented 4 years ago

google-translate-0.0.9.zip 改好了,换了got的请求库,试试这个怎么样?

czd890 commented 4 years ago

后面这个版本OK的。666!

imlinhanchao commented 4 years ago

修复问题的版本 1.0.10 已上线,可以卸载调试版本再上扩展商店安装最新版本。