svgexport icon indicating copy to clipboard operation
svgexport copied to clipboard

Error `undefined is not a constructor (evaluating 'el.getBBox()')`

Open vallieres opened this issue 7 years ago • 1 comments

I'm getting this error when converting a nice looking SVG. It's very similar to others I have and can't seem to understand what's the problem here.

svgexport "instagram_076.svg" "instagram_076.png" png 85% 2000:2000

File is here

Terminal is giving out:

$ svgexport "instagram_076.svg" "instagram_076.png" png 85% 2000:2000
TypeError: undefined is not a constructor (evaluating 'el.getBBox()')

  undefined:24
  :33
TypeError: null is not an object (evaluating 'input.width')

vallieres avatar Jan 15 '18 19:01 vallieres

It seems whatever was causing this has been fixed. Using the example file with version 0.3.2 of svgexport

svgexport instagram_076.svg instagram_076.png 500:500
file:///C:\Users\foo\instagram_076.svg C:\Users\foo\instagram_076.png png 100% 0.25x 0:0:2000:2000 500:500

I was able to generate the following:

instagram_076

I came here because I had run into the same error text. Mine was possibly more related to #16? For anyone searching for what might be going on, in my case I did have <?xml version="1.0" encoding="utf-8"?> as mentioned in the #16, however I had a <link href="https://foo.com/css?family=Bar" rel="stylesheet"> in my svg file which was causing the svgexport tool to complain. Moving the link tag outside of the svg file fixed my issue.

virtuoushub avatar Oct 25 '18 14:10 virtuoushub