When loading typescript files with the lang#typescript layer enabled and using neovim, the error E117: Unknown function: TSOnBufEnter is given and the typescript specific plugins fail to load.
Expected behavior is to load the plugins associated with the typescript lang layer when opening .ts files.
From a fresh installation of SpaceVim, add the following to ~/.SpaceVim.d/init.toml:
[[layers]]
name = "lang#typescript"
using neovim, open a file with a .ts extension.
SpaceVim layers:
hello,have you installed neovim python client? May be you need to run pip3 install neovim.
And the debug info key binding is SPC h I not SPC h l.
Oh thanks I didn't realize. The debug info is supposed to be copied to clipboard but it seems it doesn't work on MacOS? Is there any other way to get the debug information?
the neovim python client is indeed installed (v0.2.6)
in neovim,if you need to copy content to system clipboard, you need to install xclip, please read :h clipboard-provider in neovim.
SPC h I errors in both neovim and vim8 on my machine
Error detected while processing function SpaceVim#issue#report[1]..<SNR>220_open[3]..<SNR>220_template:
line 1:
E696: Missing comma in List: (), '- vim version: ' . (has('nvim') ? '-' : s:CMP.version()), '- neovim version: ' . (has('nvim') ? s:CMP.version() : '-'), '- SpaceVim version: ' . g:spacevim_version, '- SpaceVim status: ', '', '```' ] + s:
spacevim_status() + [ '```', '', '## The reproduce ways from Vim starting (Required!)', '', '## Output of the `:SPDebugInfo!`', ''] + split(s:CMP.execute(':SPDebugInfo'), "\n") + [ '## Screenshots', '', 'If you have any screenshots for th
is issue please upload here. BTW you can use https://asciinema.org/ for recording video in terminal.' ]
E15: Invalid expression: [ '<!-- please remove the issue template when request for a feature -->', '## Expected behavior, english is recommend', '', '## Environment Information', '', '- OS: ' . SpaceVim#api#import('system').name(), '- vim
version: ' . (has('nvim') ? '-' : s:CMP.version()), '- neovim version: ' . (has('nvim') ? s:CMP.version() : '-'), '- SpaceVim version: ' . g:spacevim_version, '- SpaceVim status: ', '', '```' ] + s:spacevim_status() + [ '```', '', '## Th
e reproduce ways from Vim starting (Required!)', '', '## Output of the `:SPDebugInfo!`', ''] + split(s:CMP.execute(':SPDebugInfo'), "\n") + [ '## Screenshots', '', 'If you have any screenshots for this issue please upload here. BTW you ca
n use https://asciinema.org/ for recording video in terminal.' ]
Just as an additional datapoint, yanking to the system clipboard by yanking to the + register seems to work fine, just SPC h I doesn't work.
please update spacevim
the command :SPUpdate SpaceVim failed with the following error on both neovim and vim8:
Error detected while processing function SpaceVim#commands#update_plugin[6]..Spa
ceVim#plugins#manager#update:
line 43:
E121: Undefined variable: g:Config_Main_Home
E116: Invalid arguments for function fnamemodify(g:Config_Main_Home, ':h') }
E15: Invalid expression: { 'name' : 'SpaceVim', 'path' : fnamemodify(g:Config_Ma
in_Home, ':h') }
:SPUpdate without an argument completed successfully, but I still get an error on SPC h I:
Error detected while processing function SpaceVim#issue#report[1]..<SNR>213_open
[3]..<SNR>213_template[1]..<SNR>7_version[4]..<SNR>7_parser:
line 3:
E684: list index out of range: 1
E15: Invalid expression: split(v_list[0], '-')[1]
edit: Actually it seems that I only get the SPC h I error on vim8. Neovim now completes it successfully.
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
:SPDebugInfo!g:spacevim_altmoveignoreft = ['Tagbar', 'vimfiler']
g:spacevim_api_json_true = v:null
g:spacevim_auto_disable_touchpad = 1
g:spacevim_autocomplete_method = 'deoplete'
g:spacevim_background = 'dark'
g:spacevim_buffer_index_type = 4
g:spacevim_checkinstall = 1
g:spacevim_colorscheme = 'gruvbox'
g:spacevim_colorscheme_bg = 'dark'
g:spacevim_colorscheme_default = 'desert'
g:spacevim_custom_color_palette = []
g:spacevim_custom_plugins = []
g:spacevim_debug_level = 1
g:spacevim_default_indent = 2
g:spacevim_dein_installed = 1
g:spacevim_denite_leader = '\f'
g:spacevim_disabled_plugins = []
g:spacevim_enable_ale = 0
g:spacevim_enable_cursorcolumn = 0
g:spacevim_enable_cursorline = 1
g:spacevim_enable_debug = 0
g:spacevim_enable_googlesuggest = 0
g:spacevim_enable_guicolors = 1
g:spacevim_enable_insert_leader = 1
g:spacevim_enable_javacomplete2_py = 0
g:spacevim_enable_key_frequency = 0
g:spacevim_enable_language_specific_leader = 1
g:spacevim_enable_neocomplcache = 0
g:spacevim_enable_neomake = 1
g:spacevim_enable_os_fileformat_icon = 0
g:spacevim_enable_powerline_fonts = 1
g:spacevim_enable_statusline_display_mode = 0
g:spacevim_enable_tabline_filetype_icon = 1
g:spacevim_enable_vimfiler_filetypeicon = 0
g:spacevim_enable_vimfiler_gitstatus = 0
g:spacevim_enable_vimfiler_welcome = 1
g:spacevim_enable_ycm = 0
g:spacevim_error_symbol = '✖'
g:spacevim_expand_tab = 1
g:spacevim_filemanager = 'vimfiler'
g:spacevim_filetype_icons = {}
g:spacevim_force_global_config = 0
g:spacevim_gitcommit_issue_icon = ''
g:spacevim_gitcommit_pr_icon = ''
g:spacevim_github_username = ''
g:spacevim_guicolors = 1
g:spacevim_guifont = ''
g:spacevim_hiddenfileinfo = 1
g:spacevim_hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
g:spacevim_info_symbol = 'ⓘ'
g:spacevim_keep_server_alive = 1
g:spacevim_language = ''
g:spacevim_leader_guide_default_group_name = ''
g:spacevim_leader_guide_flatten = 1
g:spacevim_leader_guide_hspace = 5
g:spacevim_leader_guide_max_size = 0
g:spacevim_leader_guide_position = 'botright'
g:spacevim_leader_guide_run_map_on_popup = 1
g:spacevim_leader_guide_sort_horizontal = 0
g:spacevim_leader_guide_submode_mappings = {'<C-C>': 'win_close'}
g:spacevim_leader_guide_vertical = 0
g:spacevim_lint_on_save = 1
g:spacevim_lint_on_the_fly = 0
g:spacevim_max_column = 120
g:spacevim_neobundle_installed = 0
g:spacevim_plugin_bundle_dir = '/Users/daniel.dyla/.cache/vimfiles/'
g:spacevim_plugin_manager = 'dein'
g:spacevim_plugin_manager_processes = 16
g:spacevim_plugin_name = 'vimshell.vim'
g:spacevim_project_rooter_automatically = 1
g:spacevim_project_rooter_patterns = ['.git/', '_darcs/', '.hg/', '.bzr/', '.svn/']
g:spacevim_realtime_leader_guide = 1
g:spacevim_relativenumber = 1
g:spacevim_search_tools = ['rg', 'ag', 'pt', 'ack', 'grep']
g:spacevim_sidebar_width = 30
g:spacevim_simple_mode = 0
g:spacevim_smartcloseignoreft = ['tagbar', 'vimfiler', 'SpaceVimRunner', 'SpaceVimREPL', 'SpaceVimQuickFix', 'HelpDescribe', 'VebuggerShell', 'VebuggerTerminal']
g:spacevim_smartcloseignorewin = ['__Tagbar__', 'vimfiler:default']
g:spacevim_snippet_engine = 'neosnippet'
g:spacevim_src_root = 'E:\sources\'
g:spacevim_statusline_display_mode = 0
g:spacevim_statusline_inactive_separator = 'arrow'
g:spacevim_statusline_left_sections = ['winnr', 'filename', 'major mode', 'syntax checking', 'minor mode lighters']
g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos', 'percentage']
g:spacevim_statusline_separator = 'arrow'
g:spacevim_statusline_unicode_symbols = 1
g:spacevim_terminal_cursor_shape = 2
g:spacevim_unite_leader = '\f'
g:spacevim_version = '0.8.0-dev'
g:spacevim_vim_help_language = 'en'
g:spacevim_vim_plug_installed = 0
g:spacevim_vimcompatible = 0
g:spacevim_warning_symbol = '⚠'
g:spacevim_wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,*.ttf,*.TTF,*.png,*/target/*,.git,.svn,.hg,.DS_Store,*.svg'
g:spacevim_windows_index_type = 0
g:spacevim_windows_leader = 's'
g:spacevim_windows_smartclose = 'q'
SpaceVim clipboard support check report:
Checking +clipboard:
SUCCEED!
SpaceVim environment check report:
Current progpath: nvim(/usr/local/Cellar/neovim/0.2.2_1/bin/nvim)
version: 800
OS: mac
SpaceVim lua support check report:
Checking +lua:
Failed : Known issue, neovim do not support lua now.
SpaceVim python support check report:
Checking +python3:
SUCCEED!
Checking +python:
SUCCEED!
[ SpaceVim ] : logger file does not exists, only log for current process will be shown!
[ SpaceVim ] [10:35:36] [ Info ] find config file: /Users/daniel.dyla/.SpaceVim.d/init.toml
[ SpaceVim ] [10:35:36] [ Info ] loadding cached config: /Users/daniel.dyla/.cache/SpaceVim/conf/_Users_daniel_dyla__SpaceVim_d_init_toml.json
[ SpaceVim ] [10:35:36] [ Info ] SpaceVim server startup at:/tmp/spacevim_nvim_server
[ SpaceVim ] [10:35:38] [ Info ] Find project root('.git/','/Users/daniel.dyla/playground/davis/animus/src/app.ts'):/Users/daniel.dyla/playground/davis/animus/.git/
[ SpaceVim ] [10:35:38] [ Info ] change to root:/Users/daniel.dyla/playground/davis/animus
If you have any screenshots for this issue please upload here. BTW you can use https://asciinema.org/ for recording video in terminal.
Run :UpdateRemotePlugins, this is caused by unite.vim.
:UpdateRemotePlugins has the following output:
remote/host: node host registered plugins ['nvim_typescript']
remote/host: python3 host registered plugins []
remote/host: generated rplugin manifest: /Users/daniel.dyla/.local/share/nvim/rp
lugin.vim
and still has the same bug
I had the same problem after updating, and running :UpdateRemotePlugins didn't solve it.
To fixing this I had to:
/home/jmsegrev/.local/share/nvim/rplugin.vim.cd to the directory where the plugin nvim_typescript is located. ./install.sh.:UpdateRemotePlugins This should fix the problem, but the underlying reason of why the layer is not properly installing nor the plugin registration is updated, is not clear to me.
thanks @jmsegrev but that doesn't appear to work for me
@dyladan Have you enabled language-server-protocol?
@dyladan what is the output of :CheckHealth
@zhujinxuan I don't know. how would I check and/or enable that?
:CheckHealth:
health#nvim_typescript#check
========================================================================
## Find Node
- OK: node is in $PATH
## Find Local Typescript
- WARNING: No local server found, using global
- ADVICE:
- Install typescript locally for more accurate tooling
$ npm install typescript --save-dev
## Find Global Typescript
- OK: global tsserver is found
## Check for node bindings
- OK: node bindings found
health#nvim#check
========================================================================
## Configuration
- OK: no issues found
## Performance
- OK: Build type: Release
## Remote Plugins
- OK: Up to date
## terminal
- INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
- INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
- INFO: $XTERM_VERSION=''
- INFO: $VTE_VERSION=''
- INFO: $SSH_TTY=''
health#provider#check
========================================================================
## Clipboard (optional)
- OK: Clipboard tool found: pbcopy
## Python 2 provider (optional)
- INFO: `g:python_host_prog` is not set. Searching for python2.7 in the environment.
- INFO: Executable: /usr/bin/python2.7
- INFO: Python2 version: 2.7.10
- INFO: python2.7-neovim version: 0.2.6
- OK: Latest python2.7-neovim is installed: 0.2.6
## Python 3 provider (optional)
- INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment.
- INFO: Executable: /usr/local/bin/python3
- INFO: Python3 version: 3.6.5
- INFO: python3-neovim version: 0.2.6
- OK: Latest python3-neovim is installed: 0.2.6
## Ruby provider (optional)
- INFO: Ruby: ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
- INFO: Host: /usr/local/bin/neovim-ruby-host
- OK: Latest "neovim" gem is installed: 0.7.0
## Node provider (optional)
- INFO: Node: v8.9.3
- INFO: Host: /Users/daniel.dyla/.nvm/versions/node/v8.9.3/bin/neovim-node-host
- OK: Latest "neovim" npm is installed: 4.1.0
I can not reproduce this issue, maybe you can reinstall this plugin via:
call dein#reinstall(['nvim-typescript'])
I solved this issue by deleting the directory ~/.cache/vimfiles/.cache, then restarted nvim and ran :UpdateRemotePlugins.
I finded the plugin nvim-typescript path (/Users/peter/.cache/vimfiles/.cache/init.vim/.dein/rplugin/node/nvim_typescript) from my local /Users/peter/.local/share/nvim/rplugin.vim. In the plugin directory, there was not a ./install.sh file which @jmsegrev mentioned. It may be caused by cache I thought, so I deleted the cache diretory, then restarted nvim and ran :UpdateRemotePlugins. The problem is solved.
@PeterDing Thanks for your info.
I didn't need to delete the cache, :UpdateRemotePlugins and then restarting nvim fixed the issue
Sorry, guess I forgot to make a comment here. This issue has been fixed with my commit 4912e7e. Just follow @Fetz's comment and type in :UpdateRemotePlugins.
You should see:
remote/host: node host registered plugins ['nvim_typescript']
If you don't. Update your SpaceVim and try again. If that _still_ doesn't work, please make sure your neovim is up to date. I've found out Ubuntu 16.04 has too old of a neovim version to work properly
OK Thanks :)
Tried everything suggested here and the only thing that worked was @wsdjeg suggested fix - which was call dein#reinstall(['nvim-typescript']).
However, since this issue keeps popping up and we have to apply various fixes to get it working - perhaps this shouldn't be closed? Appears that a bug exists, has been reproduced, and continues to be a problem.
Have a brand new machine and this error is still very pronounced. Just reporting it here but after fiddling around with it for about 30 mins I got it working (although its basically random, install layer, reinstall, run RemoteUpdatePlugins, call dein#reinstall, etc).
Reporting same/similar issue.
:checkhealth outputs ERROR: node bindings were not found .... Please update ... neovim
My neovim is of latest 0.3.8 version. SpaceVim - 1.3.0-dev.
When trying to open *.ts file:
Error detected while processing BufEnter Autocommands for "*.ts": E117: unknown function: TSOnBufEnter
Update No.1:
Looks like this is related to neovim. When opening with vim, it seems to work.
@oswee I was having the same issue.
node bindings were not found error on checkhealth. But that did not solve theunknonw function TSOnBufEnter` error when entering typescript filecall dein#reinstall(['nvim-typescript']). If i recall you must have NPM or YARN installed. I fixed that by updating the node version manager I am using (asdf) and it plugin (asdf node) and doing reshim and then trying to do dain reinstall again and then the problem was fixed.
Most helpful comment
I can not reproduce this issue, maybe you can reinstall this plugin via:
call dein#reinstall(['nvim-typescript'])