isaacs / sax-js

A sax style parser for JS
Other
1.09k stars 325 forks source link

Max buffer length exceeded: attribValue #252

Open gobinath2389 opened 2 years ago

gobinath2389 commented 2 years ago

I am reading a big file(10 Gb) using SAXStream. I am running into this error below.

I tried increasing the sax.MAX_BUFFER_LENGTH = 64 1024 to sax.MAX_BUFFER_LENGTH = 64 1024 *10 But still no luck with this issue.

Error: Max buffer length exceeded: attribValue Line: 0 Column: 172807703 Char: at error (/Users/node_modules/sax/lib/sax.js:651:10) at checkBufferLength (/Users/node_modules/sax/lib/sax.js:125:13) at SAXParser.write (/Users/node_modules/sax/lib/sax.js:1505:7) at SAXStream.write (/Users/node_modules/sax/lib/sax.js:239:18) at PassThrough.ondata (_stream_readable.js:716:22) at PassThrough.emit (events.js:315:20) at PassThrough.EventEmitter.emit (domain.js:483:12) at addChunk (_stream_readable.js:295:12) at readableAddChunk (_stream_readable.js:271:9) at PassThrough.Readable.push (_stream_readable.js:212:10) Emitted 'error' event on SAXStream instance at: at errorOrDestroy (internal/streams/destroy.js:108:12) at SAXStream.onerror (_stream_readable.js:752:7) at SAXStream.emit (events.js:315:20) at SAXStream.EventEmitter.emit (domain.js:483:12)

donglinkai commented 1 year ago

try to set the following code

const sax = require('sax');
sax.MAX_BUFFER_LENGTH = Infinity;