vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.76k stars 388 forks source link

`ts.createCachableExportInfoMap is not a function` with Neovim integration #967

Closed gquemener closed 2 years ago

gquemener commented 2 years ago

I'm trying to connect to volar using neovim, however the latter fails to launch the server with the following error:

[ERROR][2022-02-17 09:18:13] .../vim/lsp/rpc.lua:420    "rpc"   "volar-server"  "stderr"        "/home/gildas/.local/share/nvim/lsp_servers/volar/node_modules/@volar/server/node_modules/@volar/shared/out/ts.js:11
    const exportMapCache = ts.createCacheableExportInfoMap({
                              ^

TypeError: ts.createCacheableExportInfoMap is not a function
    at Object.addCacheLogicToLanguageServiceHost (/home/gildas/.local/share/nvim/lsp_servers/volar/node_modules/@volar/server/node_modules/@volar/shared/out/ts.js:11:31)
    at Object.createLanguageService (/home/gildas/.local/share/nvim/lsp_servers/volar/node_modules/@volar/server/node_modules/vscode-vue-languageservice/out/languageService.js:132:12)
    at /home/gildas/.local/share/nvim/lsp_servers/volar/node_modules/@volar/server/out/project.js:67:35
    at async sendDocumentDiagnostics (/home/gildas/.local/share/nvim/lsp_servers/volar/node_modules/@volar/server/out/projects.js:155:37)
    at async updateDiagnostics (/home/gildas/.local/share/nvim/lsp_servers/volar/node_modules/@volar/server/out/projects.js:127:13)
"

I am using the following version of neovim:

NVIM v0.6.1
Build type: Release
LuaJIT 2.0.5
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

and the following version of volar:

@lsp-installer/volar.tmp@1.0.0 /home/gildas/.local/share/nvim/lsp_servers/volar
└── @volar/server@0.31.4
yaegassy commented 2 years ago

Please upgrade your typescript version to "v4.4" or later and see if that solves the problem.

Or downgrade @volar/server to v0.31.3.

gquemener commented 2 years ago

Downgrading to v0.31.3 resolved the issue. Thanks :+1:

johnsoncodehk commented 2 years ago

Duplicate of #962