markdown-preview.nvim
markdown-preview.nvim copied to clipboard
Can not open markdown preview
Describe the bug
On running the command :MarkdownPreview
, an error is shown and preview window does not open.
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received an instance of Array
To Reproduce Steps to reproduce the behavior:
- Open a markdown file
- Run
:MarkdownPreview
Expected behavior A new tab should open in browser with preview of markdown file.
Screenshots
Desktop (please complete the following information):
- OS: Fedora 35
- CheckHealth-
- INFO: Platform: linux
- INFO: Nvim Version: NVIM v0.7.0
- INFO: Node version: v17.7.2
- INFO: Script: /home/raghav/.local/share/lunarvim/site/pack/packer/opt/markdown-preview.nvim/app/server.js
- INFO: Script exists: 1
- OK: Using node
Log:
No log output produced in session
I had a similar issue that I managed to fix. I delete my local copy of this plugin, and then reinstalled everything.
-
Delete
~/.vim/plugged/markdown-preview.nvim
:rm ~/.vim/plugged/markdown-preview.nvim
-
Open Neovim:
nvim
-
Install plugins again:
:PlugInstall
-
Close Neovim and open a
.md
file. -
Run
:MarkdownPreview
.
That's what worked for me at least.
Thanks for the help @johnnymatthews, unfortunately, this did not work for me :(
I support that reinstalling plugin doesn't help.
A clean run with only markdown preview works as expected so closing this.
Removing this line is what seems to have fixed the issue
vim.g.mkdp_browser = { "/bin/google-chrome" }
I do not know the reason