Error 404
OS: MacOS Sonoma (v14.2.1) Reproduction:
-
:MarkdownPreviewToggleor -
:MarkdownPreview
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:
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.
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?
Ok funnily enough, everything works now. I guess the latest updates have fixed this.