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

error when writing values from Node.js #37

Open
jiangts opened this issue Feb 7, 2016 · 0 comments
Open

error when writing values from Node.js #37

jiangts opened this issue Feb 7, 2016 · 0 comments

Comments

@jiangts
Copy link

jiangts commented Feb 7, 2016

I tried the foreign values example, but am still getting

Cannot write

Error: Cannot write 
    at Error (native)
    at Object.com.cognitect.transit.impl.writer.emitMap (.../node_modules/transit-js/transit.js:2887:7)
    at Object.com.cognitect.transit.impl.writer.marshal (.../node_modules/transit-js/transit.js:2932:50)
    at Object.com.cognitect.transit.impl.writer.marshalTop (.../node_modules/transit-js/transit.js:2950:59)
    at com.cognitect.transit.impl.writer.Writer.write [as write] (.../node_modules/transit-js/transit.js:2962:231)
    ... 

The object I'm writing comes from an object returned by node-pg.

Any ideas of what's wrong?

Update: I found this post https://groups.google.com/forum/#!topic/transit-format/zGXBjF82Llg
Similar to his problem, if I roundtrip the data with JSON.stringify and JSON.parse, transit-js writes without error. However, that solution isn't very helpful as I lose all data type information in the JSON roundtrip...

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

1 participant