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

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

Open
avimmer opened this issue Mar 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@avimmer
Copy link

avimmer commented Mar 22, 2024

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

@avimmer avimmer added the bug Something isn't working label Mar 22, 2024
@weirongxu
Copy link
Owner

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

@avimmer
Copy link
Author

avimmer commented Mar 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants