Skip to content

Maximum call stack size exceeded #781

@KaKi87

Description

@KaKi87
  • Are you running the latest version?
  • Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?
  • Have you checked the docs for helpful APIs and examples?

Description

Input

Code

import { XMLBuilder } from 'fast-xml-parser';
const builder = new XMLBuilder({
  ignoreAttributes: false,
  attributeNamePrefix: '@_',
  preserveOrder: true,
  format: true,
  indentBy: '  ',
  processEntities: true,
});
builder.build([
  {
    'foo': [
      { 'bar': [{ '@_V': 'baz' }] },
      { 'fum': [{ 'qux': '' }] },
      { 'hello': [{ '#text': 'world' }] }
    ]
  }
]);

Output

Uncaught RangeError: Maximum call stack size exceeded
    at Object.keys (<anonymous>)
    at propName (node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js:1:1)
    at arrToStr (node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js:1:1)
    at arrToStr (node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js:1:1)
    at arrToStr (node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js:1:1)
    at arrToStr (node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js:1:1)
    at arrToStr (node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js:1:1)
    at arrToStr (node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js:1:1)
    at arrToStr (node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js:1:1)
    at arrToStr (node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js:1:1)

expected data

<foo>
  <bar V="baz"/>
  <fum>
    <qux/>
  </fum>
  <hello>world</hello>
</foo>

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates. Visit SoloThought to know about recent features.


Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions