1

I had created and executed a BPMN process using VSCode. I was able to run the process successfully. But on trying to import the SVG, getting the following error Unable to write file 'c:\Program Files\Microsoft VS Code\d:\Projects{mypath}\src\main\resources\Sample-svg.svg' (Unknown (FileSystemError): Error: EINVAL: invalid argument, mkdir 'c:\Program Files\Microsoft VS Code\d:')

Saw issue might be of write access, but unable to obtain it. VSCode version: 1.64.2

Added all bpmn and java extensions needed.

Have also tried starting and running as admin, provided the app all required write permissions in app security, still no change.

codeforHarman
  • 115
  • 1
  • 10
  • Could you try running VSC in Administrator mode? – Neele22 Feb 23 '22 at 10:26
  • Tried that, as edited above, ran in admin mode, gave the app exclusive read and write permissions, no use @Neele22 – codeforHarman Feb 23 '22 at 10:31
  • Now that I look at it, your path looks quite strange. It seems as if VSCode is trying to find the "D:\..." path inside the "C:\Program Files\Microsoft VS Code" path – Neele22 Feb 23 '22 at 10:33
  • I am running my project in D:/, that shouldn't be an issue right? Projects shall be created in folders outside C @Neele22 – codeforHarman Feb 23 '22 at 10:36
  • Well, it seems that this error (mkdir 'c:\Program Files\Microsoft VS Code\d:') tells you that it is trying to create the D: drive inside the microsoft VS Code folder on the C: drive. That can't be right. – Neele22 Feb 23 '22 at 10:38
  • So, is there some path i need to edit in VSCode? The project cannot be created inside C, so @Neele22 – codeforHarman Feb 23 '22 at 10:40
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/242306/discussion-between-codeforharman-and-neele22). – codeforHarman Feb 23 '22 at 10:41

1 Answers1

1

This seems to be a bug in how NodeJS's path.resolve resolves a different drive path.

This is how the path where the SVG will be exported is defined:

const svgUri = editor.document.uri.with({ path: __path.resolve(svgFilePath, svgFileName) });

By default, the SVG is exported to fileDirname, which is the path where your BPMN file is. But in this case path.resolve is appending this path "c:\Program Files\Microsoft VS Code".

A simple way to workaround/fix this is to go to your VSCode Settings and find the Kogito > Bpmn: Svg File Path settings and add a forward slash (/) before "${fileDirname}", leaving the setting with the value: "/${fileDirname}".

Or you can edit your VSCode's settings.json file, adding this property:

{
   ...
   "kogito.bpmn.svgFilePath": "/${fileDirname}"
}

Kogito > Bpmn: Svg File Path setting