Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object .js,.node,.json,.coffee,.sjs has no method 'test' #27

Closed
pararuk opened this issue May 3, 2014 · 4 comments
Closed

Object .js,.node,.json,.coffee,.sjs has no method 'test' #27

pararuk opened this issue May 3, 2014 · 4 comments

Comments

@pararuk
Copy link

pararuk commented May 3, 2014

Hi,

I'm using your library:

load('config')
.then('mongoose')
.then('models')
.then('controllers')
.then('routes')
.into('app');

And receiving an error:
Object .js,.node,.json,.coffee,.sjs has no method 'test'

Windows 7, Node v0.10.25

@pararuk
Copy link
Author

pararuk commented May 3, 2014

I've done a little logging of the express-load.js file.

On 52 line you do:
if ((! options.extlist instanceof RegExp) && options.extlist instanceof Array) {

And ! operation seems to be executed before the instanceof

I changed it as following:
if (!(options.extlist instanceof RegExp) && options.extlist instanceof Array) {

And things go right.

@a14m
Copy link

a14m commented May 4, 2014

i'm also receiving a similar error for a similar use...

/dir/node_modules/express-load/lib/express-load.js:106
s.checkext && fs.statSync(script).isFile() && !this.options.extlist.test(scrip
                                                                    ^ 
TypeError: Object .js,.node,.json,.coffee,.sjs has no method 'test'
    at ExpressLoad.then (/dir/node_modules/express-load/lib/express-load.js:106:91)
    at new ExpressLoad (/dir/node_modules/express-load/lib/express-load.js:57:8)
    at module.exports (/dir/node_modules/express-load/lib/express-load.js:286:10)
    at Object.<anonymous> (/dir/server.js:8:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)

Node v0.10.26

@jarradseers
Copy link
Owner

I've updated npm, sorry this is fixed in 1.1.13, cheers.

@a14m
Copy link

a14m commented May 5, 2014

great, it works fine... thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants