Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

write after end #8

Open
Nickstr opened this issue Nov 25, 2016 · 0 comments
Open

write after end #8

Nickstr opened this issue Nov 25, 2016 · 0 comments

Comments

@Nickstr
Copy link

Nickstr commented Nov 25, 2016

Using the example code of the repo + the starting setup of express-js i'm running into an error where the first request works but the request after that returns the following error:

Error: write after end
    at writeAfterEnd (_stream_writable.js:159:12)
    at Rsvg.Writable.write (_stream_writable.js:204:5)
    at Readable.ondata (_stream_readable.js:529:20)
    at emitOne (events.js:90:13)
    at Readable.emit (events.js:182:7)
    at Readable.read (_stream_readable.js:361:10)
    at flow (_stream_readable.js:744:26)
    at emitReadable_ (_stream_readable.js:413:3)
    at nextTickCallbackWith1Arg (node.js:464:9)
    at process._tickCallback (node.js:386:17)

Code used for the express route:

app.post('/create', function(req, res) {
    var s = new stream.Readable();
    s._read = function noop() {};
    s.push(JSON.parse(req.body.svg));
    s.push(null)
    s.pipe(svg)
    res.end()
});

Cheers!

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

No branches or pull requests

1 participant