Open nicholasf opened 12 years ago
I have this same problem. I haven't been able to fix it, but here is what I've found.
I installed the util.js library and used it to inspect the val object by adding this line prior to line 187. console.log(util.inspect(val, 1, true));
val is a function object, not a string object. Function objects do not have the replace method as part of their parent class so do not inherit it, string objects do. Even though there is a bit of type checking in the Client.protoype.escape method where this problem occurs, at the time the replace method is used, val is not of type string, and thus the error is generated.
I tried many ways to fix this (mainly involving hunting down where the replace function is invoked and casting the val argument to a string, but that broke the escaping function and thus the corresponding query as well), but I am a neophyte in Javascript and am learning node.js as a way to learn Javascript and my solutions didn't work. Perhaps you will fair better.
Hope this helps.
Hi,
Ectypes has changed quite a bit and I have stopped using Sequelize (we wrote an ORM ourselves - https://github.com/moneytribeaustralia/downstairs.js ).
If you want to fix ectypes-sequelize have a look at ectypes-downstairs: https://github.com/moneytribeaustralia/ectypes-downstairs.js/blob/master/lib/ectypes-downstairs.js . It will probably be very simple to upgrade ectypes-sequelize to use the latest version of ectypes and have things work for you.
Btw, hooks have been dropped in ectypes now. Instead there are 'befores' which are more powerful.
the stacktrace: