docToolchain / diagrams.net-intellij-plugin

An IntelliJ plugin which allows you to edit diagrams.net (formerly known as draw.io) diagrams directly in IntelliJ!
https://plugins.jetbrains.com/plugin/15635-diagrams-net-integration
Apache License 2.0
134 stars 16 forks source link

Diagrams don't load in IntelliJ 2022.3.x #201

Closed blaghed closed 5 months ago

blaghed commented 1 year ago

Hi,

As the title says, while using IntelliJ 2022.3 the diagrams no longer load. The "tabs" are still visible at the bottom:

ahus1 commented 1 year ago

Thanks for reporting this. I've just published version 0.2.0 of the plugin which now builds on JDK17 which fixed the problem on IntelliJ 2022.3 for me.

Please give it a try.

The pre-release of the plugin is available from GitHub releases.

To try out a pre-release:

  1. Download the new release file diagrams.net-intellij-plugin-xx.xx.xx.zip from the Assets section of the release.
  2. Go to menu File | Settings... | Plugins | Gear Icon (⛭).
  3. Choose Install plugin from disk....
  4. Choose the downloaded file in the file selection dialogue.
  5. Restart the IDE to activate the new plugin version.
blaghed commented 1 year ago

Hi @ahus1 ,

Thank you so much for the prompt reply! Sadly, however, the provided solution still has the same behaviour for me.

0.2.0 applied: 2023-02-16 11_01_44-Settings

ahus1 commented 1 year ago

Hm, did you restart you IDE after the update? Could you please add a screenshot of your ide, so I see what you see?

blaghed commented 1 year ago

Hi @ahus1 ,

Yes, I did restart. You can find the screenshot below, left side shows the XML view (OK) and the right side shows the editor view (NOK). On the editor view, all I get is either the loading icon or a black screen altogether.

diagrams-err

blaghed commented 1 year ago

Hi again @ahus1 ,

So, meanwhile I noticed the exact same behaviour when using the ADOC plugin, in that the preview pane looked exactly as the issue described above, so I went to dig on that side of the github-verse and caught this, which exactly describes what is happening here: https://github.com/asciidoctor/asciidoctor-intellij-plugin/issues/499

In this issue, which I guess you are aware of, there are some references to "OpenAPI" and "Swagger" related errors, and indeed my version of IntelliJ actually comes with an "OpenAPI Specifications" plugin bundled insided!

Incredibly, all I had to do was disable that plugin and both the ADOC preview and the Diagrams.net editor reported here started working again, like magic!

Oddly enough, I was then able to re-enable the "OpenAPI Specification" plugin, and they still work. Sadly, after these actions, it is the "OpenAPI" one that behaves a bit wonky, but in a much preferable manner than the other 2's wonkyness.

With this, can I safely conclude that there is some compatibility issue between these plugins? Please note that I am using the "Ultimate Edition", and this "OpenAPI Specification" plugin is bundled by default there -- I've no clue if it is also bundled in the "Community Edition".

Hope this helps track down the issue!

ahus1 commented 1 year ago

There is now a pre-release 0.2.1 which uses "off-screen" rendering which seems to be more robust.

If the diagram doesn't show, please choose the action "Open Devtools Window for the current Diagrams.net Preview"

image

This dialog opens the Chromium developer tools, which should show for example a console. If something problematic happens in the preview, this would then hopefully show some additional log messages.

image

There are additional information on how to capture JCEF information, see https://intellij-support.jetbrains.com/hc/en-us/articles/360016644459-Reporting-JCEF-problems. Unfortunately I didn't find information to run IntelliJ with the console open on Windows: for me it always spawned in the background, so it didn't help me much. It might reveal more information on other operating systems.

The pre-release of the plugin is available from GitHub releases.

To try out a pre-release:

  1. Download the new release file diagrams.net-intellij-plugin-xx.xx.xx.zip from the Assets section of the release.
  2. Go to menu File | Settings... | Plugins | Gear Icon (⛭).
  3. Choose Install plugin from disk....
  4. Choose the downloaded file in the file selection dialogue.
  5. Restart the IDE to activate the new plugin version.
blaghed commented 1 year ago

Hi @ahus1 ,

Super sorry for the delay in replying, specially since you have been so proactive on this issue! I ended up taking so long that 0.2.1 is already normally available by now, so I didn't have to use the zip.

Anyway, with this, the problems remains exactly the same. Even a bit more unfortunate, since the upgrade caused a re-lapse to the original behaviour reported here, and the workaround of disabling the "OpenAPI Specification" plugin no longer works on this version.

I also tried opening the "JCEF DevTools" as you mentioned, with the "Open Devtools Window for the current Diagrams.net Preview" action, but the window that pops up from this is just blank as well (same as the diagrams and ADOC's and so on):

2023-03-14 14_02_17-JCEF DevTools

Rolled it back to 0.2.0 which works (with the workaround).

blaghed commented 1 year ago

Hi @ahus1 ,

This still has the "awaiting feedback" tagged onto to it, not really sure how to remove it for you. Anyways, found another interesting workaround for this issue, in case someone else is facing it, and this one seems to work regardless of the version used.

Just add "ide.browser.jcef.gpu.disable=true" to your IntelliJ custom properties!

Cheers

ahus1 commented 1 year ago

@blaghed - I've now removed "awaiting feedback".

Thanks for finding out about the GPU disable. Can you explain a bit more about your environment? Are you using a remote desktop / virtual desktop, and what operating system are you running? Thanks!

Looking for hints on the IntelliJ tracker, I found for example this issue: https://youtrack.jetbrains.com/issue/IDEA-243056 & https://youtrack.jetbrains.com/issue/IDEA-308582

blaghed commented 1 year ago

Hi @ahus1,

Are you using a remote desktop / virtual desktop

Yes, I am accessing it remotely via Citrix.

what operating system are you running?

Local system is running Windows 11, while remote system is using Windows 10.

Both Windows 11 and Citrix are already themselves the cause of much grief on my side, but I honestly did not expect this to be related to this particular one 🤣/😭

ahus1 commented 10 months ago

I've been experimenting on how to show a hint to users when the JCEF preview doesn't work for the AsciiDoc plugin. If that works, I could try something similar for this plugin.

Could someone using a remote desktop try this for me, that is: when the registry setting is not done, it would show the hint?

See https://github.com/asciidoctor/asciidoctor-intellij-plugin/issues/1371#issuecomment-1869610054 for instructions.

ahus1 commented 5 months ago

I didn't get feedback on my previous comment, so I'm closing this issue.

In the meantime, there might be another cuase: This might be similar to https://github.com/docToolchain/diagrams.net-intellij-plugin/issues/298. I added a possible workaround there. Please have a look at that issue.

blaghed commented 5 months ago

Sorry for forgetting, @ahus1 . This is now working without the workaround mentioned before, so can't check that the notification pops up, sorry.