christianvoigt / argdown

a simple syntax for complex argumentation
https://argdown.org
923 stars 30 forks source link

Export to SVG/PDF fails in VS-Code #193

Closed babig closed 3 years ago

babig commented 4 years ago

When I try to export a Viz.Js map to SVG or PDF no output is generated. When I export to a Dagre Map to SVG, output is generated but results in Boxes are blacked out.

I realize that a similar issue been discussed in #159 . But in contrast to what's reported there, I do not get any error. Also, as suggested there, I'm working within a workspace.

The problem occurs with absolutely every map I try, e .g.

[a] 
   +> [b]

Versions are:

christianvoigt.argdown-vscode v1.5.0

Version: 1.50.0 (system setup)
Commit: 93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3
Date: 2020-10-07T06:10:52.432Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 6.1.7601
christianvoigt commented 4 years ago

Thanks for the report! Please update to the current version (v1.5.2) and tell us if your issue still occurs.

babig commented 4 years ago

Umps, that leads to another issue. VS-Code stubbornly claims that the argdown extension is up to date; that's why I didn't realize/forgot that there is a newer version. But even after unsinstalling argdown, the extension gallery offers only version 1.5.0 to me.

christianvoigt commented 4 years ago

Sorry for the confusion (I should not have answered while having the flu...). Actually v1.5.0 is the current version of the extension. I published some fixes to @argdown/cli and other packages under v1.5.2 that were not relevant for the VSCode extension.

I don't know what is wrong with your extension, but a first step would be to redownload it. If you uninstall an extension, VSCode will not actually delete the files of the extension. It will only "deactivate" it. Next time you install the extension it will use these existing files instead of downloading new ones.

To make sure VSCode re-downloads the extension, you have to delete the files yourself. For Windows you will find the extensions under %USERPROFILE%\.vscode\extensions (you can simply paste that path without changes into the address bar of the file explorer). Look for a folder called christianvoigt.argdown-vscode-1.5.0 and delete it. After that you can reinstall the extension and it will be downloaded from the Microsoft Marketplace.

If this does not help, could you open the "Output" window in VScode and check the "Log (Extension host)", "Argdown" (if it exists) or "Argdown Server" channels for any interesting error messages? You can select the channel in the dropdown menu in the top right of the Output window.

babig commented 4 years ago

Thanks. I've deleted the files and reinstalled the extension as advised. The issue persists. I don't find any messages in the channels you mention, except for [Log - 12:32:57] Manager creates new preview... in "Argdown".

babig commented 4 years ago

Addendum: after restarting VS-Code once more, I get the following message in the "Argdown Language Server" channel immediately upon opening an argdown-file:

(node:364) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Argdown language server initialized.
christianvoigt commented 4 years ago

I had not updated VSCode to 1.5.0 before. I think I can reproduce the issue now, which is good news. The bad news is that VSCode seems to have made some changes that are causing this and so far I don't know what it is.

For now, you can downgrade VSCode or use @argdown/cli for your exports.

Thanks again for the report!

christianvoigt commented 3 years ago

This is finally fixed in argdown-vscode v1.5.3 and will work with the newest version of VSCode (1.50.1).

Sorry for the long wait, it took a while to find and solve the root of the problem. It was caused by the webpack bundling of the extension (and the language server) in combination with viz.js and newer versions of node. To make things even more fun, updating to webpack 5 and viz.js 3.2 caused a chain reaction of new issues I had to fix.