Skip to content
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

Vega.Export.save!() function generates invalid images for PNG and SVG #76

Closed
zgcarvalho opened this issue Apr 9, 2024 · 2 comments · Fixed by #77
Closed

Vega.Export.save!() function generates invalid images for PNG and SVG #76

zgcarvalho opened this issue Apr 9, 2024 · 2 comments · Fixed by #77

Comments

@zgcarvalho
Copy link

Hello,
I have encountered an issue when using the Vega.Export.save!() functions in Elixir Vega Lite. When generating images, both PNG and SVG types are coming out as invalid while the PDF type works as expected.
For reference, I have installed all the required npm packages globally:

$ npm install -g vega vega-lite canvas

When attempting to generate an SVG image with Vega.Export.to_svg(), the output starts with a deprecation warning:

(node:13698) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node21 --trace-deprecation ...` to show where the warning was created)

Once these first two lines (containing the deprecation warning) are manually removed from the SVG file, it works as intended.
Any assistance or guidance on how to resolve this issue would be much appreciated. Thank you in advance for your time and help.

@josevalim
Copy link
Contributor

Should we set this option to false instead?

opts = [stderr_to_stdout: true]

@jonatanklosko
Copy link
Member

@josevalim ah, correct! The idea was to capture the error too, but that doesn't work with warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants