svgo-gui
svgo-gui copied to clipboard
Uncaught node.js Error
nice :)
i'll take a look, thanks.
@deepsweet just checked, still getting the error above. Intermittent on some svgs..
i have exact the same error but on windows . Uncaught node.js Error
TypeError: Argument must be a string at eval (file:///C:/Temp/nw74320_26661/script.js:103:55) at Object.eval as oncomplete .
with all of SVGs i tested (~10).should i post some of them?
i Have also same error, every time i drag a svg file in to this window it shows me above error...
I had the same error both with svgo-gui and gulp-svgo and tried exporting it from Adobe Illustrator in a different format.
With a little trial and error I found out that the error occurs when the option Preserve Illustrator Editing Capabilites is checked:
If you look at the files, you can see the difference and where it might get stuck.
Example: Simple black rectangle svg:
preserve capabilites unchecked
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<rect x="8" y="13" width="83" height="41"/>
</svg>
preserve capabilites checked
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
<!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
<!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
<!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
<!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
<!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
<!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
]>
<svg version="1.1" id="Ebene_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100"
enable-background="new 0 0 100 100" xml:space="preserve">
<switch>
<foreignObject requiredExtensions="&ns_ai;" x="0" y="0" width="1" height="1">
<i:pgfRef xlink:href="#adobe_illustrator_pgf">
</i:pgfRef>
</foreignObject>
<g i:extraneous="self">
<rect x="8" y="13" width="83" height="41"/>
</g>
</switch>
<i:pgf id="adobe_illustrator_pgf">
<![CDATA[
eJzsveuSJLeVJvgE/g6xP9pMHBtGA46ra8faLCIjU60eXWii1N27PWO0UjFFVasutKqitOqX2YfZ
F9vvOwfwC+BRmSSrxJppJozFTAccgONycK4f/u7/+OzzT09fvvr9/afuaA7D3/3dzev7J29fvf7p
QZ4efv78+Tdv3r7mo5/85pODTUeDQqef5y9KwX++f/3m2auXP2WWlcw7vv2TX3zzpydvDj/7H9GO...
Thanks @lgaechter, I had the same problem and can confirm that unchecking the 'Preserve Illustrator Editing Capabilities' option before saving the SVG prevents this error from happening in SVG GUI.
I'm getting the error even when not checking off that option in Illustrator.
In the Illustrator export, make sure "CSS Properties: " is NOT set to "Style Attributes (Entity References)".
I switched to just "Style Attributes" and did not receive the error again.