lowlighter / libs

🍱 Collection of carefully crafted TypeScript standalone libraries. Minimal, unbloated, convenient.
https://jsr.io/@libs
MIT License
125 stars 11 forks source link

@libs/xml: Failed when parsing large XML file. #41

Closed mashizora closed 6 months ago

mashizora commented 6 months ago

Hi, It seems that the new xml@5 implementation cannot handle large files. When I trying to parse a 4MB~ XML file, it throws an error:

error: Uncaught (in promise) SyntaxError: Malformed XML document    
    throw new SyntaxError("Malformed XML document")
          ^
    at Module.parse (https://jsr.io/@libs/xml/5.0.2/parse.ts:109:11)
    at file:///D:/workspace/test.ts:6:5
    at eventLoopTick (ext:core/01_core.js:168:7)
lowlighter commented 6 months ago

Hi ! Indeed seems so be an issue caused by WASM XML parser crashed: RangeError: Maximum call stack size exceeded I'll look into it