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

Error: param.forEach is not a function #340

Closed
ameliariely opened this issue Oct 1, 2015 · 7 comments
Closed

Error: param.forEach is not a function #340

ameliariely opened this issue Oct 1, 2015 · 7 comments

Comments

@ameliariely
Copy link

Hey! I've just started trying to integrate some comments into my restify API and I'm unable to build the actual docs. I ran "apidoc -e node_modules" and after all my files are inspected I get this error. It looks like it might be internal, or I'm doing something wrong. Any help?

error: params.forEach is not a function
debug: TypeError: params.forEach is not a function
at /usr/local/lib/node_modules/apidoc/node_modules/apidoc-core/lib/workers/api_param_title.js:77:24
at Array.forEach (native)
at /usr/local/lib/node_modules/apidoc/node_modules/apidoc-core/lib/workers/api_param_title.js:74:33
at Array.forEach (native)
at /usr/local/lib/node_modules/apidoc/node_modules/apidoc-core/lib/workers/api_param_title.js:68:20
at Array.forEach (native)
at Object.postProcess (/usr/local/lib/node_modules/apidoc/node_modules/apidoc-core/lib/workers/api_param_title.js:67:17)
at /usr/local/lib/node_modules/apidoc/node_modules/apidoc-core/lib/worker.js:95:20
at /usr/local/lib/node_modules/apidoc/node_modules/lodash/index.js:3159:15
at baseForOwn (/usr/local/lib/node_modules/apidoc/node_modules/lodash/index.js:2089:14)

@ameliariely ameliariely changed the title param.forEach is not a function Error: param.forEach is not a function Oct 1, 2015
@rottmann
Copy link
Member

rottmann commented Oct 1, 2015

Can you add --debug and check / post the output.

@ameliariely
Copy link
Author

Sorry this is the end of the --debug output

@ameliariely
Copy link
Author

Here's a link to a gist with the entire output: https://gist.github.com/brunerson/0104a1e80de0ddaadd89

@rottmann
Copy link
Member

rottmann commented Oct 2, 2015

Did you use somewhere the deprecated apiParamTitle ?
You should use instead apiDefine to the define a title:

/**
  * @apiDefine TitleName Some title text
  */

/**
 * @api ....
 * @apiParam (TitleName) {String} var Some description.
 */

@ameliariely
Copy link
Author

No I didn't... I used apiDefine and apiParam. I'm not sure what's going on!

@ameliariely
Copy link
Author

I figured out the problem! It was that I had '.' in some group names. For example:
@apiParam (user.save) {String} user

@ameliariely
Copy link
Author

Thanks for your help @rottmann !!

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

2 participants