You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I apologize if this is posted in the wrong place, but looking at the XML-JS's Quick Start example we have
var convert = require('xml-js');
var xml =
'<?xml version="1.0" encoding="utf-8"?>' +
'<note importance="high" logged="true">' +
' <title>Happy</title>' +
' <todo>Work</todo>' +
' <todo>Play</todo>' +
'</note>';
var op = { compact: true, spaces: 4 };
var result1 = convert.xml2json(xml, op);
console.log(result1);
Converting back,
console.log(convert. json2xml(result1, op));
Which gives the following error:
json2xml.js:4 Uncaught ReferenceError: Buffer is not defined
at Object.module.exports [as json2xml] (json2xml.js:4)
at enyoConstructor.handleExport (DataControl.js:357)
at enyoConstructor.dispatch (Component.js:779)
at enyoConstructor.dispatchEvent (Component.js:687)
at enyoConstructor.dispatchEvent (Control.js:1311)
at enyoConstructor.dispatchBubble (Component.js:734)
at enyoConstructor.bubbleUp (Component.js:645)
at enyoConstructor.dispatchEvent (Component.js:716)
at enyoConstructor.dispatchEvent (Control.js:1311)
at enyoConstructor.dispatchBubble (Component.js:734)
at enyoConstructor.bubble (Component.js:617)
at Object.dispatchBubble (dispatcher.js:161)
at Object.dispatch (dispatcher.js:115)
at Object.sendTap (gesture.js:142)
at Object.up (gesture.js:102)
at Object.mouseup (gesture.js:295)
Other than what's up there, I grabbed xml-js through
npm install --save xml-js
Thoughts?
The text was updated successfully, but these errors were encountered:
Sorry, turns out I was having a bit of a brain fart. It was Blob that we had polyfilled for older browsers. I think given that it's trying to access Buffer that it is getting confused about being packed by our node build tools. Is there some way to force the library to use the browser version? Buffer is a node concept.
Hey,
I apologize if this is posted in the wrong place, but looking at the XML-JS's Quick Start example we have
Converting back,
Which gives the following error:
Other than what's up there, I grabbed xml-js through
Thoughts?
The text was updated successfully, but these errors were encountered: