Hi,
i’m tring to insert some line of javascript in node function to work on Amazon Signing V4.
So, when i try to insert some line of javascript after the execution appear “ERROR: Cannot read properties of undefined (reading ‘every’) [Line 852]” And the details are:
TypeError: Cannot read properties of undefined (reading 'every')
at Object.normalizeItems (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/NodeExecuteFunctions.js:852:23)
at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Function/Function.node.js:97:34)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:598:28)
at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:557:53
So i don’t understand if is a core error/bug or my fault…The Javascript code is simple as this:
var crypto = require("crypto-js");
function getSignatureKey(key, dateStamp, regionName, serviceName) {
var kDate = crypto.HmacSHA256(dateStamp, "AWS4" + key);
var kRegion = crypto.HmacSHA256(regionName, kDate);
var kService = crypto.HmacSHA256(serviceName, kRegion);
var kSigning = crypto.HmacSHA256("aws4_request", kService);
return kSigning;
}
(I have imported with NPM “crypto-js” and also “exported” the module for n8n)
Thank you.