markdown-preview.nvim icon indicating copy to clipboard operation
markdown-preview.nvim copied to clipboard

Can not open markdown preview

Open rag-hav opened this issue 2 years ago • 3 comments

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:

  1. Open a markdown file
  2. Run :MarkdownPreview

Expected behavior A new tab should open in browser with preview of markdown file.

Screenshots Screenshot from 2022-05-28 13-05-01

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

rag-hav avatar May 28 '22 07:05 rag-hav

I had a similar issue that I managed to fix. I delete my local copy of this plugin, and then reinstalled everything.

  1. Delete ~/.vim/plugged/markdown-preview.nvim:

    rm ~/.vim/plugged/markdown-preview.nvim
    
  2. Open Neovim:

    nvim
    
  3. Install plugins again:

    :PlugInstall
    
  4. Close Neovim and open a .md file.

  5. Run :MarkdownPreview.

That's what worked for me at least.

johnnymatthews avatar May 30 '22 15:05 johnnymatthews

Thanks for the help @johnnymatthews, unfortunately, this did not work for me :(

rag-hav avatar Jun 29 '22 00:06 rag-hav

I support that reinstalling plugin doesn't help.

swapfile-dev avatar Jul 05 '22 16:07 swapfile-dev

A clean run with only markdown preview works as expected so closing this.

rag-hav avatar Jan 13 '23 00:01 rag-hav

Removing this line is what seems to have fixed the issue

vim.g.mkdp_browser = { "/bin/google-chrome" }

I do not know the reason

rag-hav avatar Jan 13 '23 00:01 rag-hav