voldikss / coc-extensions

🌸 Collections of coc.nvim extensions maintained by @voldikss
122 stars 6 forks source link

error: this.engines is not iterable #104

Closed IstPlayer closed 3 years ago

IstPlayer commented 3 years ago

[coc.nvim] error on notification "doKeymap": this.engines is not iterable # map call [coc.nvim] Command error: this.engines is not iterable # command call

This warning appears wherever coc-translator is called, including :CocCommand translator.popup/echo/replace hello and nmap define in init.vim.

My system environment:

OS: WSL2-ArchWSL (Arch Linux on WSL2)
vim version: NVIM v0.4.4
node version: v15.3.0
coc.nvim version: 0.0.79-3658eda4fa
coc-translator: Current version 1.5.0 is up to date.

My init.vim:

" Translating current text in popup (CocCommand translator.*)
nmap ;t <Plug>(coc-translator-p)
vmap ;t <Plug>(coc-translator-pv)

My coc.nvim configuration:

"translator.engines": {
  "type": "array",
  "default": [
  "bing",
  "google",
  "youdao",
  "haici"
   ]
},

Some logs:

2020-11-28T01:41:45.082 INFO (pid:10578) [services] - registered service "highlight"
2020-11-28T01:41:45.128 INFO (pid:10578) [language-client-index] - highlight started with 10591
2020-11-28T01:41:45.150 INFO (pid:10578) [plugin] - coc.nvim 0.0.79-3658eda4fa initialized with node: v15.3.0 after 205ms
2020-11-28T01:41:49.183 ERROR (pid:10578) [attach] - Notification error: doKeymap [ 'translator-p' ] TypeError: this.engines is not iterable
    at Translator.<anonymous> (/home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:523:34)
    at Generator.next (<anonymous>)
    at /home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:257:71
    at new Promise (<anonymous>)
    at __awaiter (/home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:253:12)
    at Translator.translate (/home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:509:16)
    at Helper.<anonymous> (/home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:180:49)
    at Generator.next (<anonymous>)
    at fulfilled (/home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:96:58)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)

2020-11-28T01:42:57.325 ERROR (pid:10578) [commands] - TypeError: this.engines is not iterable
    at Translator.<anonymous> (/home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:523:34)
    at Generator.next (<anonymous>)
    at /home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:257:71
    at new Promise (<anonymous>)
    at __awaiter (/home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:253:12)
    at Translator.translate (/home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:509:16)
    at Helper.<anonymous> (/home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:192:49)
    at Generator.next (<anonymous>)
    at /home/hrand/.cache/nvim/coc/extensions/node_modules/coc-translator/lib/index.js:99:71
    at new Promise (<anonymous>)
issue-label-bot[bot] commented 3 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.92. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

IstPlayer commented 3 years ago

Sorry, I found it.