Closed awaistechverx closed 6 years ago
My Bad sorry :p
I had the same problem:
kamana_api | TypeError: Key must be a buffer
kamana_api | at TypeError (native)
kamana_api | at new Hmac (crypto.js:92:16)
kamana_api | at Object.Hmac (crypto.js:90:12)
kamana_api | at generateSignature (/usr/src/app/node_modules/amazon-product-api/lib/utils.js:4:21)
kamana_api | at generateQueryString (/usr/src/app/node_modules/amazon-product-api/lib/utils.js:107:38)
kamana_api | at Object.browseNodeLookup (/usr/src/app/node_modules/amazon-product-api/lib/index.js:14:15)
kamana_api | at Promise (/usr/src/app/amazon.js:80:57)
kamana_api | at _amazonAction (/usr/src/app/amazon.js:80:10)
kamana_api | at amazonRequest (/usr/src/app/amazon.js:66:19)
kamana_api | at next (native)
but only if I run this inside a docker container.
what did you do to solve it?
Sorry, my bad as well, I was passing empty credentials:
amazon.createClient({
awsId: credentials.AWS_ID,
awsSecret: credentials.AWS_SECRET,
awsTag: credentials.AWS_TAG
});
AWS_ID, AWS_SECRET and AWS_TAG were empty string. Maybe it could be a good Idea passing a more specific error
👍
I had the same error caused by passing empty credentials. Thank you @jurgob for specifying what the mistake was! ❤️
i am getting this error when i put my code in production:
crypto.js:91 this._handle.init(hmac, toBuf(key)); ^