philosowaffle / vs-openapi-designer

OpenApi Designer Extension for VS Code
https://marketplace.visualstudio.com/items?itemName=philosowaffle.openapi-designer
GNU General Public License v3.0
15 stars 2 forks source link

Not able to compile or preview #19

Closed Vinno97 closed 5 years ago

Vinno97 commented 6 years ago

Hi,

I cannot seem to get the extension to work and though I wish I could give you a detailed description of the error, I cannot find much info about what exactly goes wrong.

The Compile Schema option does not show any error, but the preview options show an error message and log the following error to Log(Extension Host):

[2018-09-28 10:40:30.042] [exthost3] [error] TypeError: Cannot read property 'update' of undefined
    at updateViewer (/home/vincent/.vscode/extensions/philosowaffle.openapi-designer-0.2.0/src/extension.js:107:12)
    at runDesigner (/home/vincent/.vscode/extensions/philosowaffle.openapi-designer-0.2.0/src/extension.js:124:9)
    at /home/vincent/.vscode/extensions/philosowaffle.openapi-designer-0.2.0/src/extension.js:161:9
    at e._executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:712:994)
    at e.$executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:713:479)
    at e._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:671:983)
    at e._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:671:701)
    at e._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:670:767)
    at e._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:670:536)
    at /usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:669:452
    at /usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:672:575
    at /usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:96:903
    at e.fire (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:98:218)
    at a (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:162:713)
    at Socket._socketDataListener (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:162:932)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20) openapidesigner.runDesignerInSideView

I am using the OpenAPI 3.0.0 spec and my files have no errors according to swagger-cli validate.

At first I tried using the extension on a .yaml file with references to other files. When this did not work, I also tried to run the extension on a .json file compiled by the swagger-cli. This also did not work.

I am willing to provide more info if necessary.

philosowaffle commented 6 years ago

Hi,

Unfortunately I am not able to recreate the issue locally. So let's see if we can gather some more info.

1) Are you still able to recreate the issue? 2) If so, please document any errors or output again here, like you did before. 3) Do you have anything running on port 9005? If so, this could be interfering with the extension. You can change the default port the extension uses by changing the openApiDesigner.defaultPort setting. 4) It looks like you may be on a mac or *nix system based on the paths in your trace. I will try to get my hands on a similar OS and see if I can recreate the issue there.

Vinno97 commented 6 years ago

Hi, thank you for you response. I was not able to get to the same machine as I originally got the error on, but I was able to reproduce it on another one as well.

Regarding your questions:

  1. I am able to recreate the issue, also on a different machine. It does not appear to be a conflict with another extension, since it also happens when it's the only enabled extension.
  2. See following error
    Error: Running the contributed command:'openapidesigner.runDesignerInSideView' failed.
    at e._executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:726:802)
    at e.$executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:727:212)
    at e._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:681:309)
    at e._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:681:27)
    at e._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:679:802)
    at e._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:678:993)
    at /usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:677:791
    at /usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:98:597
    at e.fire (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:99:917)
    at a (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:164:787)
    at Socket._socketDataListener (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:164:1006)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)
  3. I cannot find any process that is using that port.
  4. I am using Ubuntu 18.04 on both machines that I tried, but I will check it on Windows and update this message with my findings. Edit: it seems to be OS-related. It works as expected on Windows.
phani1kumar commented 5 years ago

Facing the same issue on Ubuntu 18.04

thccorni commented 5 years ago

I also had problems with the extension. I'm not completely sure if this is related, but maybe it helps investigating the issue.

I've started vscode in ~/Code/my-project and tried all preview options. All of them failed. I noticed an error message in the extension host protocol saying ~/code/my-project does not exist (so the folder Code was lowercase). I then moved the project to another directory with everything lowercase and the extension seemed to work correct.

I am running on elementary OS Juno.

EDIT: https://github.com/philosowaffle/vs-openapi-designer/blob/64efcb5e8a0eb33970bce3e86e5df58cbbca789f/src/extension.js#L135

philosowaffle commented 5 years ago

@thccorni & @phani1kumar & @Vinno97

Created a PR with the fixes suggested by @thccorni. I checked in a compiled extension with the fix in it which you can find here.

If someone would be able to download that version of the extension and install it to verify the issue is resolved then I will merge it and release the fix.

Vinno97 commented 5 years ago

Thank you @philosowaffle, I will try it as soon as possible

Vinno97 commented 5 years ago

Hi, I have tested it on a new installation using the method described in https://github.com/philosowaffle/vs-openapi-designer/issues/19#issuecomment-425451969, with both the version from the marketplace and your new .vsix. The first didn't work with (as was expected), but your new version worked perfectly!

philosowaffle commented 5 years ago

The fix has been released under version 0.2.1 and should be available in the Marketplace shortly.

Github Marketplace