neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.48k stars 960 forks source link

[coc.nvim] UnhandledRejection: TypeError: Cannot read properties of undefined (reading "forEach") #4705

Closed sajjathossain closed 1 year ago

sajjathossain commented 1 year ago

Result from CocInfo

versions

vim version: NVIM v0.9.1 node version: v16.13.2 coc.nvim version: 0.0.82-b7375d5f 2023-01-30 05:09:03 +0800 coc.nvim directory: /home/cpt_n3m0/.local/share/lazy.config/lazy/coc.nvim term: tmux platform: linux

Log of coc.nvim

2023-07-18T11:35:05.185 INFO (pid:57575) [extension:coc-git] - Looking for git in: git 2023-07-18T11:35:05.458 INFO (pid:57575) [extension:coc-tabnine] - Using tabnine from /home/cpt_n3m0/.config/coc/extensions/coc-tabnine-data/binaries/4.5.20/x86_64-unknown-linux-musl/TabNine 2023-07-18T11:35:05.475 WARN (pid:57575) [workspace] - workspace.createOutputChannel is deprecated, please use window.createOutputChannel instead. at Object. (/home/cpt_n3m0/.config/coc/extensions/node_modules/coc-tailwindcss/out/index.js:14:7870) at Generator.next () 2023-07-18T11:35:05.540 INFO (pid:57575) [plugin] - coc.nvim initialized with node: v16.13.2 after 737 2023-07-18T11:35:06.404 INFO (pid:57575) [attach] - Request action: diagnosticList [] 2023-07-18T11:35:08.810 INFO (pid:57575) [attach] - Request action: diagnosticList [] 2023-07-18T11:35:09.266 INFO (pid:57575) [attach] - Request action: ensureDocument [] 2023-07-18T11:35:09.269 INFO (pid:57575) [attach] - Request action: hasProvider [ 'documentSymbol' ] 2023-07-18T11:35:09.281 INFO (pid:57575) [attach] - receive notification: highlight [] 2023-07-18T11:35:09.977 INFO (pid:57575) [attach] - Request action: diagnosticList [] 2023-07-18T11:35:11.406 INFO (pid:57575) [attach] - Request action: diagnosticList [] 2023-07-18T11:35:13.861 INFO (pid:57575) [attach] - Request action: diagnosticList [] 2023-07-18T11:35:15.033 INFO (pid:57575) [attach] - Request action: diagnosticList [] 2023-07-18T11:35:16.710 INFO (pid:57575) [attach] - Request action: ensureDocument [] 2023-07-18T11:35:16.712 INFO (pid:57575) [attach] - Request action: hasProvider [ 'documentSymbol' ] 2023-07-18T11:35:16.717 INFO (pid:57575) [attach] - receive notification: highlight [] 2023-07-18T11:35:18.389 INFO (pid:57575) [attach] - Request action: ensureDocument [] 2023-07-18T11:35:18.392 INFO (pid:57575) [attach] - Request action: hasProvider [ 'documentSymbol' ] 2023-07-18T11:35:18.396 INFO (pid:57575) [attach] - receive notification: highlight [] 2023-07-18T11:35:18.911 INFO (pid:57575) [attach] - Request action: ensureDocument [] 2023-07-18T11:35:18.914 INFO (pid:57575) [attach] - Request action: hasProvider [ 'documentSymbol' ] 2023-07-18T11:35:18.917 INFO (pid:57575) [attach] - receive notification: highlight [] 2023-07-18T11:35:21.853 INFO (pid:57575) [attach] - Request action: ensureDocument [] 2023-07-18T11:35:21.857 INFO (pid:57575) [attach] - Request action: hasProvider [ 'documentSymbol' ] 2023-07-18T11:35:21.862 INFO (pid:57575) [attach] - receive notification: highlight [] 2023-07-18T11:35:22.436 INFO (pid:57575) [attach] - Request action: diagnosticList [] 2023-07-18T11:35:23.618 INFO (pid:57575) [attach] - Request action: diagnosticList [] 2023-07-18T11:35:25.038 INFO (pid:57575) [attach] - Request action: ensureDocument [] 2023-07-18T11:35:25.039 INFO (pid:57575) [attach] - Request action: hasProvider [ 'documentSymbol' ] 2023-07-18T11:35:25.040 INFO (pid:57575) [attach] - receive notification: highlight [] 2023-07-18T11:35:29.362 INFO (pid:57575) [attach] - Request action: ensureDocument [] 2023-07-18T11:35:29.365 INFO (pid:57575) [attach] - Request action: hasProvider [ 'documentSymbol' ] 2023-07-18T11:35:29.367 INFO (pid:57575) [attach] - receive notification: highlight [] 2023-07-18T11:35:29.565 INFO (pid:57575) [attach] - Request action: diagnosticList [] 2023-07-18T11:35:29.788 INFO (pid:57575) [attach] - receive notification: doAutocmd [ 3, 1 ] 2023-07-18T11:35:30.112 INFO (pid:57575) [services] - LanguageClient ESLint state change: stopped => starting 2023-07-18T11:35:30.308 INFO (pid:57575) [attach] - receive notification: highlight [] 2023-07-18T11:35:30.387 INFO (pid:57575) [services] - service tsserver started 2023-07-18T11:35:30.936 INFO (pid:57575) [language-client-index] - Language server "eslint" started with 57728 2023-07-18T11:35:31.139 ERROR (pid:57575) [server] - unhandledRejection Promise {

TypeError: Cannot read properties of undefined (reading 'forEach') at PrettierEditService.getSelectors (/home/cpt_n3m0/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:4439:18) at PrettierEditService.handleActiveTextEditorChanged (/home/cpt_n3m0/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:4411:36) at processTicksAndRejections (node:internal/process/task_queues:96:5) } TypeError: Cannot read properties of undefined (reading 'forEach') at PrettierEditService.getSelectors (/home/cpt_n3m0/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:4439:18) at PrettierEditService.handleActiveTextEditorChanged (/home/cpt_n3m0/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:4411:36) at processTicksAndRejections (node:internal/process/task_queues:96:5) 2023-07-18T11:35:31.504 INFO (pid:57575) [services] - LanguageClient ESLint state change: starting => running 2023-07-18T11:35:31.511 INFO (pid:57575) [services] - service eslint started 2023-07-18T11:35:33.223 INFO (pid:57575) [attach] - receive notification: doAutocmd [ 7 ] 2023-07-18T11:35:34.256 INFO (pid:57575) [attach] - receive notification: highlight [] 2023-07-18T11:35:36.330 INFO (pid:57575) [attach] - receive notification: highlight [] 2023-07-18T11:36:41.065 INFO (pid:57575) [attach] - receive notification: doAutocmd [ 3, 7 ] 2023-07-18T11:36:44.188 INFO (pid:57575) [attach] - Request action: diagnosticList [] 2023-07-18T11:36:44.189 INFO (pid:57575) [attach] - receive notification: doAutocmd [ 6 ] ## Describe the bug Whenever I open a file in neovim I'm greeted with this error ## Reproduce the bug - open neovim - open a file ## Screenshots (optional) ![image](https://github.com/neoclide/coc.nvim/assets/59532941/5ec3dcc9-44f8-4967-99fc-8d927f455478)
fannheyward commented 1 year ago

Same issue https://github.com/neoclide/coc-prettier/issues/164. Should be fixed by https://github.com/neoclide/coc-prettier/pull/165