weirongxu / coc-markdown-preview-enhanced

Markdown Preview Enhanced for coc.nvim
Other
90 stars 1 forks source link

[BUG] "FetchError: Cannot follow redirect with body being a readable stream" when trying to render PlantUML #29

Open avimmer opened 7 months ago

avimmer commented 7 months ago

Describe the bug I'm trying to set up a PlantUML preview which markdown-preview-enhanced should have support for built-in. I'm running a local server of PlantUML on localhost:8081 like plantuml -picoweb:8081:localhost and set my :CocConfig to

{"markdown-preview-enhanced.plantumlServer": "https://localhost:8081/svg/"}

With markdown like

# Hello
```plantuml
@startuml
Alice -> Bob : hello
Alice <- Bob : hi
@enduml

I get the FetchError: Cannot follow redirect with body being a readable stream error instead of the image. Same config works in vscodium with markdown-preview-enhanced.

Result from CocInfo

:CocInfo ## versions vim version: NVIM v0.9.5 node version: v21.7.1 coc.nvim version: 0.0.82-84ce0312 2024-03-11 10:52:28 +0800 coc.nvim directory: /Users/REDACTED/.local/share/nvim/plugged/coc.nvim term: Apple_Terminal platform: darwin ## Log of coc.nvim 2024-03-22T18:07:32.438 INFO (pid:23369) [plugin] - coc.nvim initialized with node: v21.7.1 after 222 2024-03-22T18:07:37.328 INFO (pid:23369) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ] 2024-03-22T18:08:09.938 INFO (pid:23369) [attach] - receive notification: checkJsonExtension [] 2024-03-22T18:08:09.976 INFO (pid:23369) [services] - LanguageClient Json language server state change: stopped => starting 2024-03-22T18:08:10.019 INFO (pid:23369) [language-client-index] - Language server "json" started with 23681 2024-03-22T18:08:10.129 INFO (pid:23369) [services] - LanguageClient Json language server state change: starting => running 2024-03-22T18:08:10.136 INFO (pid:23369) [services] - service json started 2024-03-22T18:08:33.748 INFO (pid:23369) [snippets-session] - Jump to final placeholder, cancelling snippet session 2024-03-22T18:09:01.711 INFO (pid:23369) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ] 2024-03-22T18:09:56.164 INFO (pid:23369) [attach] - receive notification: checkJsonExtension [] 2024-03-22T18:18:11.250 INFO (pid:23369) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ] 2024-03-22T18:18:22.449 INFO (pid:23369) [attach] - receive notification: checkJsonExtension [] 2024-03-22T18:18:58.022 INFO (pid:23369) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ] 2024-03-22T18:20:19.346 INFO (pid:23369) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ] 2024-03-22T18:20:34.297 INFO (pid:23369) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ] 2024-03-22T18:20:42.714 INFO (pid:23369) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ] 2024-03-22T18:21:40.668 INFO (pid:23369) [attach] - receive notification: updateExtensions [] 2024-03-22T18:21:41.860 INFO (pid:23369) [model-download] - Download completed: URL { href: 'https://registry.npmjs.org/coc-pyright/-/coc-pyright-1.1.355.tgz', origin: 'https://registry.npmjs.org', protocol: 'https:', username: '', password: '', host: 'registry.npmjs.org', hostname: 'registry.npmjs.org', port: '', pathname: '/coc-pyright/-/coc-pyright-1.1.355.tgz', search: '', searchParams: URLSearchParams {}, hash: '' } 2024-03-22T18:21:41.864 INFO (pid:23369) [model-download] - Downloaded https://registry.npmjs.org/coc-pyright/-/coc-pyright-1.1.355.tgz => /Users/REDACTED/.config/coc/extensions/node_modules/coc-pyright-519fc376-9526-43e7-84d1-a3d06a437186 2024-03-22T18:27:01.700 INFO (pid:23369) [attach] - receive notification: runCommand [ 'markdown-preview-enhanced.openPreview' ]

Screenshots With this plugin

Screenshot 2024-03-22 at 19 17 27

With vscode version

Screenshot 2024-03-22 at 19 18 13
weirongxu commented 7 months ago

Hi @avimmer, have you tried using http instead of https?

avimmer commented 7 months ago

Yes, "markdown-preview-enhanced.plantumlServer": "http://localhost:8081/svg/" doesn't seem to be working either. I've worked around by using "markdown-preview-enhanced.plantumlJarPath": "/usr/local/opt/plantuml/libexec/plantuml.jar" which works better for me.