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

Export Current Diagram fails #68

Closed
Fellfalla opened this issue Sep 28, 2017 · 15 comments
Closed

Export Current Diagram fails #68

Fellfalla opened this issue Sep 28, 2017 · 15 comments

Comments

@Fellfalla
Copy link

The command Export Current Diagram (plantuml.exportCurrent) causes following exception on my machine:


TypeError: Path must be a string. Received [Function]
	at assertPath (path.js:7:11)
	at Object.isAbsolute (path.js:439:5)
	at Includer._calcIncludes (C:\Users\weber\.vscode\extensions\jebbs.plantuml-2.3.0\out\src\plantuml\diagram\includer.js:24:23)
	at Includer.addIncludes (C:\Users\weber\.vscode\extensions\jebbs.plantuml-2.3.0\out\src\plantuml\diagram\includer.js:11:18)
	at DiagramAt (C:\Users\weber\.vscode\extensions\jebbs.plantuml-2.3.0\out\src\plantuml\diagram\diagram.js:89:48)
	at Diagram.GetCurrent (C:\Users\weber\.vscode\extensions\jebbs.plantuml-2.3.0\out\src\plantuml\diagram\diagram.js:50:18)
	at Object.<anonymous> (C:\Users\weber\.vscode\extensions\jebbs.plantuml-2.3.0\out\src\plantuml\exporter\exportDocument.js:49:50)
	at Generator.next (<anonymous>)
	at fulfilled (C:\Users\weber\.vscode\extensions\jebbs.plantuml-2.3.0\out\src\plantuml\exporter\exportDocument.js:4:58)
	at <anonymous>

the command plantuml.preview does not work either.

@qjebbs
Copy link
Owner

qjebbs commented Sep 29, 2017

Do you config any invalid values in plantuml.includes?

@Fellfalla
Copy link
Author

Fellfalla commented Sep 29, 2017

There are no includes in both, local and global settings.

"plantuml.includes": [],

I recently installed plantuml. I've never tried on this machine before. Maybe it's because I installed java and graphviz with chocolatey. However, I "repaired" graphviz later on with it's .msi installer. Just to give it a try. But that did not help.

@qjebbs
Copy link
Owner

qjebbs commented Sep 29, 2017

I've no clue how it happens, How about config "plantuml.includes": [""]? how about re-install the plugin?

@Fellfalla
Copy link
Author

"plantuml.includes": [""] makes no difference. Nor as reinstall.

@qjebbs
Copy link
Owner

qjebbs commented Oct 6, 2017

Sorry, I cannot re-proceduce so I can't tell why. Does it only happen in this single machine? I doubt it has something to do with the environment. How about clear all globally installed npm package, and reinstall?

@Fellfalla
Copy link
Author

I have no nodejs-lts packages installed and reinstalled nodejs.

Maybe you could try to reproduce by installing "vscode" and "nodejs-lts" with these commands:
First install chocolatey:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Then run these commands in the powershell or cmd:
choco install visualstudiocode -y
choco install nodejs-lts -y

@qjebbs
Copy link
Owner

qjebbs commented Oct 10, 2017

I tried in VM with chocolatey, but still cannot reproduce.

@Fellfalla
Copy link
Author

Maybe I could give you more log data somehow?

@qjebbs
Copy link
Owner

qjebbs commented Nov 2, 2017

@Fellfalla I've located where the error occurs, but don't known how. If you could clone the project, and debug in your environment would be the best way out.

@c835722
Copy link

c835722 commented Nov 4, 2017

So let's try to advance bug as its a blocker for many but seem only a simple code fix will be required.
It happens for me on a Mac with vscode-insiders. It does not happen with vs-code. Is this issue (#68) specific to a version of vscode or the plugin?
What other platforms are people seeing the issue on?
I assume from the comments here it cannot be reproduced on the windows platform. Is that correct? What is it about vscode that differs per platform that might suggest why the bug might be platform specific?
Is there a set of specific instruction on how to debug this plugin?
I notice there are some high-level considerations in https://github.com/qjebbs/vscode-plantuml/blob/master/vsc-extension-quickstart.md which perhaps we could expand to a set of concrete instructions on how to get the code breakpointed at a particular line of code.

@c835722
Copy link

c835722 commented Nov 4, 2017

I backported all my plugins form vscode-insider to vscode.
This reproduced the same issue in vscode.
This suggests to me there is some type of clash between plugins.
This may be why it cannot be reproduced by some.

@c835722
Copy link

c835722 commented Nov 4, 2017

workaround found:
I found that if I disabled the Spellcheck plugin this issue is fixed for me in both vscode and vscode-insider. 😃
Can the author perhaps install the plugin and debug the clash? It may be that the bug is introduced completely by the Spellcheck plugin and the issue belongs in their repo.

@Fellfalla
Copy link
Author

@c835722 That's it! Problem solved :). Thanks a lot.

@qjebbs
Copy link
Owner

qjebbs commented Nov 5, 2017

@c835722 Thanks for figuring out how it occurs, that I could publish the fix soon. With next version, plugin should work with Spellcheck plugin without error.

@qjebbs qjebbs closed this as completed in 247c84d Nov 5, 2017
@qjebbs
Copy link
Owner

qjebbs commented Nov 5, 2017

Basically, the fault is mine. Spellcheck plugin defines a function inArray in Array.prototype, this kind of defines take effects globally for all plugins, that I get a function among strings (use for...in, which I shouldn't), and cause the problem.

Since every one may define inArray-like functions, it may cause conflicts & overrides. It's not recommended to do so, in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants