-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
big popup as svg is created #761
Comments
Hi @amunger, unfortunately, I suspect this might a Windows related bug, and unfortunately I don't have a Windows machine to test with. However, you might be able to play around by using a custom PuppeteerConfig. The first thing I'd recommend trying is: await mermaidCLIModule.run(
`${tmpDir}/diagram.md`, // input
`${tmpDir}/diagram.svg`, // output
{
outputFormat: 'svg',
puppeteerConfig: {
// uses Chrome headless shell, a faster version of chrome
// see https://developer.chrome.com/blog/chrome-headless-shell
headless: 'shell',
},
}
); Chrome headless shell tends to be much faster than the default settings, since it's a stripped out version of Chrome that doesn't have support for extensions. Alternatively, you could also try pointing puppeteer to use Microsoft Edge browser (see https://learn.microsoft.com/en-us/microsoft-edge/puppeteer/), e.g. with: await mermaidCLIModule.run(
`${tmpDir}/diagram.md`, // input
`${tmpDir}/diagram.svg`, // output
{
outputFormat: 'svg',
puppeteerConfig: {
// Replace with your browser path
executablePath: 'C:\\Program Files (x86)\\Microsoft\\Edge Dev\\Application\\msedge.exe',
},
}
); Also, this is unrelated to your issue, but if you're trying to use Mermaid in VS Code, I'd highly recommend not using And I love the name |
(I'm also working on this with Aaron). Thanks for the ideas here! We're primarily wanting to use the |
Unfortunately, I'm not a VS Code expert, but would it be possible to somehow "render" it in VS Code if you have access to a browser-environment (e.g. https://code.visualstudio.com/api/extension-guides/webview)? You could hide it so it's not visible to the user. You could also try An alternate approach is to use an external server (e.g. like https://kroki.io/), but if you're sending a lot of traffic their way, you'd probably want to self-host Kroki, or sponsor them! It's also worth looking at https://github.com/remcohaszing/mermaid-isomorphic! It's basically a Node.JS API for running Mermaid, but unlike |
Thanks for the ideas! With your hints I was able to successfully call |
Describe the bug
Using the CLI programmatically in node.js causes a large pop-up that takes up most of the screen for a few seconds as the SVG is created
To Reproduce
Here is an excerpt of the code I'm running
This video shows the popup happening twice for two attempts to create an svg from an md file.
validationPopup.mp4
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: