buglabs / node-xml2json

Converts XML to JSON using node-expat
808 stars 209 forks source link

TypeError when i use it in a vue project #184

Closed Littleor closed 5 years ago

Littleor commented 5 years ago

my code : const parser = require('xml2json');

it shows : Uncaught TypeError: Cannot read property 'indexOf' of undefined

p3x-robot commented 5 years ago

is it a server side rendering in vue? xml2json is binary, it does not work in a browser.

p3x-robot commented 5 years ago

i think https://www.npmjs.com/package/xml-js is pure js, that might work in a browser

Littleor commented 5 years ago

I have use 'x2js' to solve it,thanks!