bzixilu / dotplugin

Dot language plugin for Intellij IDEA
55 stars 10 forks source link

Problem: Error during rasterization in version 1.4 #23

Closed emma-burrows closed 2 years ago

emma-burrows commented 2 years ago

After I let the plugin update to 1.4, it is loading a blank preview with the caption "Problem: Error during rasterization". I originally noticed this in IntelliJ 2021.2.3 on MacOS Mojave, and the problem persists in the latest version (2021.2.4). I tested it with different versions of the plugin:

Graphviz was originally installed via brew which lists its version as graphviz: stable 2.47.2 and dot as available on the command line is dot - graphviz version 2.47.2 (20210527.0053)

bzixilu commented 2 years ago

@emma-burrows Could you please check that the new version (1.4.1) of the plugin solves this problem in your environment?

https://plugins.jetbrains.com/plugin/10312-dot-language/versions/stable/159392

emma-burrows commented 2 years ago

Spam filter ate the ping but I'd noticed the new version and just came here to say the problem was indeed fixed in 1.4.1! Thanks for such a speedy solution - hopefully you'll find out what was wrong with the more recent version of the graphviz library...

bzixilu commented 2 years ago

@emma-burrows Thank you for confirming!

lzhAndroid commented 2 years ago

dot - graphviz version 2.50.0,plugin version:1.4.1,mac M1 pro,this probelm are not fixed

bzixilu commented 2 years ago

@lzhAndroid could you please check whether the problem exists in 1.2v in your environment?

lzhAndroid commented 2 years ago

@lzhAndroid could you please check whether the problem exists in 1.2v in your environment?

install 1.2,show no preview is available. in 1.3,show No preview is available.Reason:Error during rasterization.

lzhAndroid commented 2 years ago

If I install android studio with intel chip ,it work fine.but install apple chip,it show Error during rasterization my computer chip is M1 pro

bzixilu commented 2 years ago

@IzhAndroid thank you for the details, I'll try to check that's wrong, but it could take some time since I have no required hardware unfortunately

lzhAndroid commented 2 years ago

@IzhAndroid thank you for the details, I'll try to check that's wrong, but it could take some time since I have no required hardware unfortunately

@bzixilu if has new version,i can help you to test it

lzhAndroid commented 2 years ago

@bzixilu I see j2v8 is only has x86_64 version.

bpedman commented 2 years ago

Had this issue on an M1 mac as well. As @lzhAndroid said, j2v8 is not available on m1 and probably won't be. There is supposed to be a fallback to either graalvm js or nashorn, however, it seems that jetbrains plugins don't have access to any ScriptEngines through the ScriptEngineManager, instead you have to use IdeScriptEngineManager, but that would require extending the graphviz-java library to implement your own GraphvizEngine.

Luckily graphviz-java also searches your PATH for dot on the command line to do the rendering, so we just need to install graphviz and then make sure its on the path. To do that, I did:

brew install graphviz
# Update the PATH variable for all GUIs launched from finder/spotlight/etc
# Assumes homebrew prefix is /opt/homebrew
sudo launchctl config user path /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbi

Reboot, then re-open intellij and it should work.