Pavliko / postcss-svg

PostCSS plug-in which to insert inline SVG to CSS and allows you to manage it colors.
http://pavliko.github.io/postcss-svg/
Creative Commons Zero v1.0 Universal
124 stars 23 forks source link

Module build failed: TypeError: node.serializeToString is not a function #25

Closed leshek-pawlak closed 7 years ago

leshek-pawlak commented 8 years ago

Hi guys! First thing - this plugin is awesome! Second thing - I've got this error after node update to version 5.3.0. (npm 3.5.2)

ERROR in ./~/css-loader!./~/postcss-loader!./css/main.css Module build failed: TypeError: node.serializeToString is not a function at XMLSerializer.serializeToString (node_modules/xmldom/dom.js:906:7) at SVGImage._addSprite (node_modules/postcss-svg/dist/lib/svg_image.js:199:40) at SVGImage._parseNode (node_modules/postcss-svg/dist/lib/svg_image.js:143:20) at SVGImage._parseNode (node_modules/postcss-svg/dist/lib/svg_image.js:148:16) at SVGImage._parseSvg (node_modules/postcss-svg/dist/lib/svg_image.js:99:18) at new SVGImage (node_modules/postcss-svg/dist/lib/svg_image.js:31:12) at Object.module.exports.addToIndex (node_modules/postcss-svg/dist/lib/svg_cache.js:65:15) at Object.module.exports.init (node_modules/postcss-svg/dist/lib/svg_cache.js:25:14) at node_modules/postcss-svg/dist/index.js:24:16 at LazyResult.run (node_modules/postcss/lib/lazy-result.js:206:20) at node_modules/postcss/lib/lazy-result.js:120:37 at LazyResult.asyncTick (node_modules/postcss/lib/lazy-result.js:134:15) at node_modules/postcss/lib/lazy-result.js:132:27 at LazyResult.asyncTick (node_modules/postcss/lib/lazy-result.js:134:15) at node_modules/postcss/lib/lazy-result.js:132:27 at LazyResult.asyncTick (node_modules/postcss/lib/lazy-result.js:134:15) at node_modules/postcss/lib/lazy-result.js:132:27 at LazyResult.asyncTick (node_modules/postcss/lib/lazy-result.js:134:15) at node_modules/postcss/lib/lazy-result.js:132:27 at LazyResult.asyncTick (node_modules/postcss/lib/lazy-result.js:134:15) at node_modules/postcss/lib/lazy-result.js:132:27 at LazyResult.asyncTick (node_modules/postcss/lib/lazy-result.js:134:15) @ ./css/main.css 4:14-117 13:2-17:4 14:20-123

andreychev commented 8 years ago

I am observing the same mistake.

Another issue: https://github.com/Pavliko/postcss-svg/issues/24. Update: https://github.com/jindw/xmldom/pull/148.

kvz commented 8 years ago

Running into this too: https://travis-ci.org/transloadit/uppy/builds/101528583#L800

kvz commented 8 years ago

Proposed this change ---^ to shield the project from issues like these.

Until that is merged, or the problem is fixed another way, feel free to use

"postcss-svg": "https://github.com/kvz/postcss-svg#9239b6dd4ab0dc3ef37f41c9cbc0e23d25549c7b",

in your package.json to fix this issue in your projects @andreychev and @Lesyek

krizka commented 8 years ago

@kvz Thanks for the fix!

leshek-pawlak commented 8 years ago

@kvz Great job! Thanks! :+1:

andreychev commented 8 years ago

@kvz :+1:

tgfjt commented 8 years ago

xmldom was fixed v0.1.21 :+1:

jonathantneal commented 7 years ago

This plugin now uses xmldoc 1.1.0. :)