Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with V10 #247

Open
martinfranz opened this issue Mar 10, 2020 · 2 comments
Open

Problems with V10 #247

martinfranz opened this issue Mar 10, 2020 · 2 comments

Comments

@martinfranz
Copy link

Hi,
with node V10 (maybe even earlier versions), SAXStream is not signaling an end. So:
await pipeline( fs.createReadStream(fileName, 'utf8'), parser ) console.log('finish')
will never reach "finish".
I'm not a master of node streams, just created some write streams. I could fix that issue (at least for my use case) by changing to Stream = require('stream').Writable, deleting the SAXStream.prototype.end function and used
SAXStream.prototype._final = function (cb) {
this._parser.end()
if (cb) cb()
}
Maybe somebody with better knowledge about node streams could fix the original sax code. At least, my simple fix resolved that particular issue...
Best regards, Martin

@georgyfarniev
Copy link

@martinfranz I'm suspecting it's because parser emitting only 'end' event, but not 'finish' as expected by pipeline function.

@WouterVanheeswijk-TomTom

Had the same issue, I'm using this work-around:

parser.once('end', () => parser.emit('finish'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants