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

nwb middleware and the user config function #238

Closed
1 of 4 tasks
jvega opened this issue Jan 19, 2017 · 3 comments
Closed
1 of 4 tasks

nwb middleware and the user config function #238

jvega opened this issue Jan 19, 2017 · 3 comments
Assignees
Labels

Comments

@jvega
Copy link

jvega commented Jan 19, 2017

This issue is a:

  • Bug report
  • Feature request
  • Question / support request
  • Other

Using nwb middleware and the user config is a function, how to pass a command?

I get:

/home/node/web/node_modules/nwb/lib/getUserConfig.js:237
      command: args._[0],
                     ^

TypeError: Cannot read property '0' of undefined
    at processUserConfig (/home/node/web/node_modules/nwb/lib/getUserConfig.js:237:22)
    at getUserConfig (/home/node/web/node_modules/nwb/lib/getUserConfig.js:435:10)
    at nwbMiddleware (/home/node/web/node_modules/nwb/lib/expressMiddleware.js:46:48)
    at Object.<anonymous> (/home/node/web/server.js:24:11)
    at Module._compile (module.js:570:32)
    at loader (/home/node/web/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/node/web/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Function.Module.runMain (module.js:604:10)
    at /home/node/web/node_modules/babel-cli/lib/_babel-node.js:159:24
    at Object.<anonymous> (/home/node/web/node_modules/babel-cli/lib/_babel-node.js:160:7)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
@insin insin added the bug label Jan 19, 2017
@insin
Copy link
Owner

insin commented Jan 19, 2017

Oof, that's a bug.

We're calling getUserConfig() to determine which type of project the middleware is being used in without properly mocking out the arguments object.

@insin insin self-assigned this Jan 19, 2017
@insin insin closed this as completed in 0cc3cc8 Jan 19, 2017
@insin
Copy link
Owner

insin commented Jan 19, 2017

Fixed in v0.14.2.

@jvega
Copy link
Author

jvega commented Jan 20, 2017

that was fast, regards

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

No branches or pull requests

2 participants