Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Trouble with stringify... #155

Open
ccorcos opened this issue Jun 15, 2018 · 0 comments
Open

Trouble with stringify... #155

ccorcos opened this issue Jun 15, 2018 · 0 comments

Comments

@ccorcos
Copy link

ccorcos commented Jun 15, 2018

I'm simply trying to log the output of the JSONStream from the Node REPL:

JSONStream = require("JSONStream")

logOut = new stream.Writable({
	write(chunk, encoding, done) {
		console.log(chunk, encoding, typeof chunk)
		done()
	}
})

stringify = JSONStream.stringify()

stringify.pipe(logOut)

stringify.push({hey: '1', b: [1,2,3,4]})

I get this error when I call .push at the bottom there:

TypeError: Invalid non-string/buffer chunk
    at validChunk (_stream_writable.js:254:10)
    at Writable.write (_stream_writable.js:288:21)
    at Stream.ondata (internal/streams/legacy.js:16:26)
    at emitOne (events.js:115:13)
    at Stream.emit (events.js:210:7)
    at drain (/Users/chet/Code/notion-next/node_modules/through/index.js:36:16)
    at Stream.stream.queue.stream.push (/Users/chet/Code/notion-next/node_modules/through/index.js:45:5)
    at repl:1:11
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at REPLServer.defaultEval (repl.js:240:29)
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