camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.49k stars 477 forks source link

Impossible to export image #1699

Closed nicolas-75 closed 4 years ago

nicolas-75 commented 4 years ago

Describe the Bug

Impossible to export image. When I do that a popup as filename and filetype then warn :

File could not be exported Error: Cannot destructure property 'encoding' of '(intermediate value)-(intermediate value)(intermediate value)' as it is undefined. Cancel / Export as ...

I had the same error with all the filetype I tried.

Steps to Reproduce

  1. Open Camunda Modeler
  2. Create new diagram or Open a diagram (BPMN processes or other)
  3. Clic on menu File -> Export as Image
  4. Choose a name then validate
  5. See the warning error message

Expected Behavior

The image is exported instead of a popup warning message

Environment


Blocked by https://github.com/electron/electron/issues/21170

pinussilvestrus commented 4 years ago

Which image type to you choose for the export? .png, .jpg, .svg?

nicolas-75 commented 4 years ago

Which image type to you choose for the export? .png, .jpg, .svg?

I had the same error with all the filetype I tried. .png, .jpg, .svg?

I had the error even if the diagram is empty. I try with the nightly builds too.

The verbose on terminal when I open the software, add new diagram, export, clic on Cancel when the error popup was displayed:

$ INFO app:main:bootstrap starting Camunda Modeler v3.6.0 INFO app:cli parsing [ '/opt/camunda-modeler/camunda-modeler' ] in '/home/nicolas' INFO app:flags searching for flags.json in paths [ '/opt/camunda-modeler/resources', '/home/nicolas/.config/camunda-modeler/resources' ] INFO app:flags found [] INFO app:flags active {} INFO app:plugins searching for plugins/*/index.js in paths [ '/opt/camunda-modeler', '/opt/camunda-modeler/resources', '/home/nicolas/.config/camunda-modeler/resources', '/home/nicolas/.config/camunda-modeler' ] INFO app:plugins found plug-in entries [] INFO app:plugins registered [] INFO app:main:bootstrap received ready [3566:0224/092049.705179:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command INFO app:main window focused INFO app:main:bootstrap received client-ready INFO app:workspace saving INFO app:workspace saving INFO app:main window focused INFO app:main window focused

oguzeroglu commented 4 years ago

Looks like an OS related issue, let's see if we can reproduce this on a Linux Manjaro distro. Thanks for reporting!

oguzeroglu commented 4 years ago

After a quick research I found this one: https://stackoverflow.com/questions/58347778/electron-fix-errorbuffer-manager-cc488-displaycompositorgl-error-gl-inv

We still need to investigate the negative side effects on performance of this --disable-gpu flag though.

nicolas-75 commented 4 years ago

When I do: $ /usr/lib/electron/electron /home/nicolas/camunda-modeler-3.6.0-linux-x64/camunda-modeler I have a lot of errors so maybe I don't do something right...

App threw an error during load /home/nicolas/camunda-modeler-3.6.0-linux-x64/camunda-modeler:1 ELF ^

SyntaxError: Invalid or unexpected token at Module._compile (internal/modules/cjs/loader.js:815:22) at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10) at Module.load (internal/modules/cjs/loader.js:735:32) at Module._load (internal/modules/cjs/loader.js:648:12) at Module._load (electron/js2c/asar.js:717:26) at Function.Module._load (electron/js2c/asar.js:717:26) at loadApplicationPackage (/usr/lib/electron/resources/default_app.asar/main.js:109:16) at Object. (/usr/lib/electron/resources/default_app.asar/main.js:155:9) at Module._compile (internal/modules/cjs/loader.js:880:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10) A JavaScript error occurred in the main process Uncaught Exception: /home/nicolas/camunda-modeler-3.6.0-linux-x64/camunda-modeler:1 ELF ^

SyntaxError: Invalid or unexpected token at Module._compile (internal/modules/cjs/loader.js:815:22) at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10) at Module.load (internal/modules/cjs/loader.js:735:32) at Module._load (internal/modules/cjs/loader.js:648:12) at Module._load (electron/js2c/asar.js:717:26) at Function.Module._load (electron/js2c/asar.js:717:26) at loadApplicationPackage (/usr/lib/electron/resources/default_app.asar/main.js:109:16) at Object. (/usr/lib/electron/resources/default_app.asar/main.js:155:9) at Module._compile (internal/modules/cjs/loader.js:880:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)

The app don't launch and I have to CTRL+C

pinussilvestrus commented 4 years ago

We do not support any other Linux distributions then Ubuntu so it seems like we are not able to help you. The errors might really depend on your operating system.

You can read about the supported environments in the documentation.

nikku commented 4 years ago

I was able to reproduce it (Arch Linux here). The issue is home made and occurs due to the fact how the Save As... dialog works on Linux: It does not automatically assume the file extension for the export file type.

Steps to reproduce:

While...

nikku commented 4 years ago

It is quite easy to run into this bug on Linux, as the Save as... dialog does not change the entered files file extension.

nicolas-75 commented 4 years ago

Great! That's work when I add the file extension.

Thanks you! :+1:

nikku commented 4 years ago

Broken upstream it seems: https://github.com/electron/electron/issues/21170.

nikku commented 4 years ago

To prevent accidental overriding of the diagram, we should pass in the diagram without the extension as a file name.

pinussilvestrus commented 4 years ago

Thanks for double-checking @nikku!

nikku commented 4 years ago

I've implemented a workaround via https://github.com/camunda/camunda-modeler/pull/1711.

We need to double check if that one does not break anything on MacOS and Windows though.