pksunkara / inflect

custom inflections for nodejs
MIT License
229 stars 18 forks source link

undefined is not a function #10

Closed adamski closed 9 years ago

adamski commented 9 years ago

I am getting the error TypeError: undefined is not a function when trying to use this package. Didn't have time to investigate but other packages are working fine for me.

pksunkara commented 9 years ago

Can you give me more details? The tests are passing as they should.

pksunkara commented 9 years ago

Can I get the stack trace?

adamski commented 9 years ago

Sure:

console.log(inflect.pluralize('apple'));
                    ^
TypeError: undefined is not a function
    at Object.<anonymous> (/path-to-my-app/server.js:34:21)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
pksunkara commented 9 years ago

Are you sure you have initialised inflect? Can you give me that line in the code too?

adamski commented 9 years ago

yes its the standard

var inflect = require('i');

If I use the other inflect npm module it works fine.

pksunkara commented 9 years ago

I am afraid you are using it wrongly. From the README,

var inflect = require('i')();
adamski commented 9 years ago

aha sorry, I completely missed that. working great now, thanks!