iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.36k stars 268 forks source link

Error 404 #644

Closed Pandoks closed 4 months ago

Pandoks commented 4 months ago

OS: MacOS Sonoma (v14.2.1) Reproduction:

Description: When starting markdown preview, it seems to start a localhost server at a random port, but it doesn't open the browser automatically. When I go to the localhost server location at the port (ie. localhost:<port>) there a 404 error.

Screenshots: 2024-02-12 10 28 18

Pandoks commented 4 months ago
return {
  "iamcco/markdown-preview.nvim",
  ft = { "markdown" },
  build = function()
    vim.fn["mkdp#util#install"]()
  end,
  keys = {
    { "<leader>p", "<cmd>MarkdownPreviewToggle<cr>", mode = "n", desc = "Toggle previewer" },
  },
}

Tried reinstallation and also changing to npm installation and that also didn't work.

kunring commented 4 months ago

I believe connecting to that address directly isn't intended to open the page. The problem is with the browser not opening. There are possibly steps you can do from your config to resolve that.

You're can see the preview page URL if you set There's a config option you can do to display the preview page URL as :MarkdownPreview is called.

Vimscript:

let g:mkdp_echo_preview_url = 1

Lua:

vim.g.mkdp_echo_preview_url = true

Does this URL work?

Pandoks commented 4 months ago

Ok funnily enough, everything works now. I guess the latest updates have fixed this.