kaishuu0123/vscode-erd

Mac Setup

JourdanDixon opened this issue · 20 comments

Hi there, will you please write up a step by step installation instructions for the dot and erd programs on Mac? Also, will you do the same on what I should put inside the Visual Studio Code Settings file for Mac? I've been trying to set it up, but I can't figure it out. Thanks!

Hi again. Just following up to see if you can give instructions with getting things setup on a Mac. I'm having trouble figuring out how to get the ERD program working to be able to actually execute my models. I believe the DOT program is good since it's a simple executable and location mapping.

@JourdanDixon

Sorry for the late reply.
I will update README.md later, but now will present installation method using mac's homebrew

Install kaishuu0123/erd-go

$ brew tap kaishuu0123/erd-go
$ brew install erd-go

# install check
$ erd-go

and erd-preview.erdPath specify erd-go

settings.json example

{
    (snip)
    "erd-preview.erdPath": "erd-go",
    (snip)
}

Great, thank you. That works now. However, the save as png, svg, and pdf do not work. Is there something special I need to do on that front?

@JourdanDixon

hm ... This may be a bug.

Is there something special I need to do on that front?

no need.
I am using erd & dot program to verify.
ERD: kaishuu0123/erd-go
DOT: kaishuu0123/graphviz-dot.js

I recognized the problem of being saved in SVG format and will continue to investigate.

thank you for your report.

@JourdanDixon
workaround.

If this problem is caused by the graphviz-dot.js command I made, try using graphviz 's dot command.

$ brew install graphviz

I ran that script and updated my settings.json file dot setting to "graphviz". It wouldn't work at all. No preview or anything. I also tried "graphviz-dot" and "graphviz-dot.js". None of them worked.

@JourdanDixon
Please show me the contents of settings.json.

(By the way, installing graphviz will install the dot command.)

{
"erd-preview.dotPath": "/Users/jourdandixon/graphviz-dot-macos-x64",
"erd-preview.erdPath": "erd-go",
"window.zoomLevel": 0
}

This works as far as viewing the preview, but I can't save as png, etc. After installing graphviz with homebrew, I tried changing the dotPath to graphviz and the other two versions, but none of those three would allow the preview or saving as...

Hello again... just checking in to see how things are going with the above.

I am facing similar issue, unable to save Preview image as PNG or PDF, noticed following errors in console.


e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:43
t._doInvokeHandler @ rpcProtocol.ts:461
t._invokeHandler @ rpcProtocol.ts:446
t._receiveRequest @ rpcProtocol.ts:366
t._receiveOneMessage @ rpcProtocol.ts:296
(anonymous) @ rpcProtocol.ts:171
e.fire @ event.ts:228
a @ ipc.net.ts:103
n._socketDataListener @ ipc.net.ts:132
emitOne @ events.js:116
emit @ events.js:211
addChunk @ _stream_readable.js:263
readableAddChunk @ _stream_readable.js:250
Readable.push @ _stream_readable.js:208
onread @ net.js:594
console.ts:134 [Extension Host] rejected promise not handled within 1 second
t.log @ console.ts:134
t._logExtensionHostMessage @ extensionHost.ts:453
(anonymous) @ extensionHost.ts:244
emitTwo @ events.js:126
emit @ events.js:214
emit @ internal/child_process.js:772
_combinedTickCallback @ internal/process/next_tick.js:141
_tickCallback @ internal/process/next_tick.js:180
mainThreadExtensionService.ts:42 [kaishuu0123.vscode-erd-preview]Cannot read property 'document' of undefined
e.$onExtensionRuntimeError @ mainThreadExtensionService.ts:42
t._doInvokeHandler @ rpcProtocol.ts:461
t._invokeHandler @ rpcProtocol.ts:446
t._receiveRequest @ rpcProtocol.ts:366
t._receiveOneMessage @ rpcProtocol.ts:296
(anonymous) @ rpcProtocol.ts:171
e.fire @ event.ts:228
a @ ipc.net.ts:103
n._socketDataListener @ ipc.net.ts:132
emitOne @ events.js:116
emit @ events.js:211
addChunk @ _stream_readable.js:263
readableAddChunk @ _stream_readable.js:250
Readable.push @ _stream_readable.js:208
onread @ net.js:594
mainThreadExtensionService.ts:43 TypeError: Cannot read property 'document' of undefined
	at context.subscriptions.push.vscode.commands.registerCommand.vscode.window.showSaveDialog.then.uri (/Users/bpatel/.vscode/extensions/kaishuu0123.vscode-erd-preview-3.1.0/out/extension.js:223:63)
	at <anonymous>

@JourdanDixon @bharat-p

I do not have enough time.
bugfix may take time.
Please wait a little more.

Sorry. (PR is always welcome.)

@JourdanDixon @bharat-p
vscode-erd released new version.
Please try again.

I want to feedback.

It saves as an SVG fine. But if I try as PDF or PNG, it actually tries to save in the SVG format, but with the PDF / PNG extension. So the end result is telling me that the format is wrong. So, it looks like it works correctly until I attempt to open the file.

@JourdanDixon
Thank you for your feedback.

hm ... It does not reproduce on my Mac. I was in embarrassment.
please tell me graphviz-dot-macos-x64 version.

$ /home/(username)/graphviz-dot-macos-x64 --version

If you are not using v0.3.1, you may have encountered a bug in graphviz-dot-macos-x64.
Please download the latest version from here.

https://github.com/kaishuu0123/graphviz-dot.js/releases

I updated everything to the current version. When I ran the "Save As...", it had this outcome:

  • SVG - Works perfectly
  • PDF - Only created an image of what would fit on a letter size paper at full size
  • PNG - Created a file but it couldn't be opened

@JourdanDixon
Sorry for the reaction is delayed.

Please attach PNG file to github.
(Perhaps the contents of the png file are text files.)

I have the same problem on mac osx 10.15.4
The screen is just black.
I tried downloading erd-go and dot to a local folder, giving chmod -x permissions and referencing them in the extension settings.
Also installed with brew and the settings, same result.
using latest versions. they work on command line.
black screen doesn't show an error or nothing.

With the newest version of all pieces, I get the same thing, just a black screen. It won't build the model anymore.

it's working for me in version 5.0.0 ! <3