sails.js - undefined is not a function- Error in Sails -
i facing following error in sails when run sails lift
follows
usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/util /schema.js:59 attributes[key].type = attributes[key].type.tolowercase(); typeerror: undefined not function @ /usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/util s/schema.js:59:51 @ array.foreach (native) @ object.schema.normalizeattributes (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/uti ls/schema.js:45:22) @ module.exports (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/core/index.js:42:34) @ module.exports (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/collection/index.js:44:8) @ new child (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/extend.js:17:39) @ initialize (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/collection/loader.js:37:10) @ loadcollection (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline.js:112:29) @ /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:162:20 @ /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:230:13 @ _arrayeach (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:81:9) @ _each (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:72:13) @ object.async.foreachof.async.eachof (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:229:9) @ object.async.foreach.async.each (/usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:206:22) @ array.async.auto.loadcollections (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline.js:125:13) @ /usr/local/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:590:38
my model has following attributes
serialno: { type: 'integer', unique: true, required: true, index: true }, createdat: { type: date, default: date.now }
i don't understand error. have no functions in corresponding controller. have not defined routes of now.
can me error?
in model have change model :
serialno: { type: 'integer', unique: true, required: true, index: true }, createdat: { type: 'date', default: date.now }
note : in sails type must have ' '
Comments
Post a Comment