Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not open markdown preview #472

Closed
rag-hav opened this issue May 28, 2022 · 5 comments
Closed

Can not open markdown preview #472

rag-hav opened this issue May 28, 2022 · 5 comments

Comments

@rag-hav
Copy link

rag-hav commented May 28, 2022

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

@johnnymatthews
Copy link

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.

@rag-hav
Copy link
Author

rag-hav commented Jun 29, 2022

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

@swapfile-dev
Copy link

I support that reinstalling plugin doesn't help.

@rag-hav
Copy link
Author

rag-hav commented Jan 13, 2023

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

@rag-hav rag-hav closed this as completed Jan 13, 2023
@rag-hav
Copy link
Author

rag-hav commented Jan 13, 2023

Removing this line is what seems to have fixed the issue

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

I do not know the reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants