matt-ward / node-dyno-to-csv

A NodeJS Module that exports AWS DynamoDB query results to CSV
Apache License 2.0
5 stars 2 forks source link

Cannot read 'Items' of null #4

Open funmonty opened 6 years ago

funmonty commented 6 years ago

Was trynna run the code. I had the AttributesToGet covered in my code. Still I am getting this error.

TypeError: Cannot read property 'Items' of null at Response.<anonymous> (node_modules/dyno-to-csv/lib/node-dyno-to-csv.js:23:25) at Request.<anonymous> (node_modules/aws-sdk/lib/request.js:364:18) at Request.callListeners (node_modules/aws-sdk/lib/sequential_executor.js:105:20)

I find the below code in your 23rd line of node-dyno-to-csv.js if (typeof data.Items !== "undefined") { output = output.concat(data.Items); }

OrenSchwartz commented 6 years ago

experiencing the same issue

matt-ward commented 6 years ago

Hey guys,

I feel ya. This library was born out of a personal need 4-5ish years ago when I was extremely naiive. And as such, I haven't updated it since then. However, since then I have learned a lot. There are a lot problems that would arise in real world use cases with this library that probably can't be fixed (well not with the way it's currently written). Should we combine our forces to create a better library? Personally, I haven't used DynamoDB in a couple of years for various reasons, but I know for sure I would never try to export a DynamoDB table as an in memory csv at present. Look forward to hearing from you guys, maybe we can come up with something!

OrenSchwartz commented 6 years ago

I actually made some modifications to it and now it working based on your code.