I am having the exception “Cannot read property ‘0’ of undefined” while using Custom Database Create Action Script. I don’t have any active Hooks and Rules enabled. In my script I have deleted all the database related scripts and only have console log but still getting the same exception.
My Create Action Script is as follows
function create(user, callback) {
console.log('User: ’ + JSON.stringify(user, null, 2));
//console.log('Email: ’ + user.email);
//console.log('Password: ’ + user.password);
return callback(null);
}
Exception Details
{
"code": 500,
"error": "Script generated an unhandled asynchronous exception.",
"details": "TypeError: Cannot read property '0' of undefined",
"name": "TypeError",
"message": "Cannot read property '0' of undefined",
"stack": "TypeError: Cannot read property '0' of undefined\n at Request.userCallback (/data/io/node12/c65481e1-f253-4ff0-9953-a67d6a1ac86a/webtask.js:41:25)\n at Request.callback (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/request.js:30:27)\n at Connection.message (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/connection.js:283:29)\n at Connection.dispatchEvent (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/connection.js:752:59)\n at MessageIO.<anonymous> (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/connection.js:685:22)\n at MessageIO.emit (events.js:314:20)\n at MessageIO.EventEmitter.emit (domain.js:483:12)\n at MessageIO.eventData (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/message-io.js:58:21)\n at Socket.<anonymous> (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/message-io.js:3:59)\n at Socket.emit (events.js:314:20)"
}
Code generated an uncaught exception: TypeError: Cannot read property '0' of undefined
at Request.userCallback (/data/io/node12/c65481e1-f253-4ff0-9953-a67d6a1ac86a/webtask.js:41:25)
at Request.callback (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/request.js:30:27)
at Connection.message (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/connection.js:283:29)
at Connection.dispatchEvent (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/connection.js:752:59)
at MessageIO.<anonymous> (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/connection.js:685:22)
at MessageIO.emit (events.js:314:20)
at MessageIO.EventEmitter.emit (domain.js:483:12)
at MessageIO.eventData (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/message-io.js:58:21)
at Socket.<anonymous> (/data/_verquire/_node12/tedious/1.11.0/node_modules/tedious/lib/message-io.js:3:59)
at Socket.emit (events.js:314:20)