documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Error while generating - parameter type invalid

Open maxbates opened this issue 10 years ago • 3 comments

I get a very nebulous error when attempting to generate documentation, and it's very unclear what to do to fix it.

It looks like this is handled in master but not the version just downloaded (beta-8), so might have already been fixed.

> documentation build src --github --output documentation --format html

myProject/node_modules/documentation/lib/output/util/formatters.js:31
      return param.type.type == Syntax.OptionalType ?
                       ^

TypeError: Cannot read property 'type' of undefined
    at formatParameter (myProject/node_modules/documentation/lib/output/util/formatters.js:31:24)
    at myProject/node_modules/documentation/lib/output/util/formatters.js:90:16
    at Array.map (native)
    at Object.formatters.parameters (myProject/node_modules/documentation/lib/output/util/formatters.js:89:35)
    at sharedImports.imports.shortSignature (myProject/node_modules/documentation/default_theme/index.js:39:51)
    at eval (lodash.templateSources[2]:14:11)
    at Array.forEach (native)
    at Object.eval [as renderSectionList] (lodash.templateSources[2]:10:10)
    at eval (lodash.templateSources[0]:208:11)
    at eval (lodash.templateSources[3]:84:11)

And an example of an offending jsDoc follows:

/**
   * start a drag operation using the given element proxy for display purposes
   * and starting from the given global position. Payload is any object representing
   * what is being dragged
   * valid options:
   * - onDrop(target) - can return a payload to use onDrop
   */
  startDrag(elementProxy, globalPosition, payload, options = {}) {

Help is appreciated! Excited to try this package out to support our project!

maxbates avatar Jul 19 '16 00:07 maxbates

Yep - This should be fixed in master - thanks for the precise bug report!

I'm planning to release beta-9 tonight or tomorrow - want to get this fix out but also want to land some improvements in the next release :)

tmcw avatar Jul 19 '16 01:07 tmcw

Just published 4.0.0-beta9 - could you try upgrading and seeing if the issue is fixed?

tmcw avatar Jul 19 '16 16:07 tmcw

No reponse, assuming this is fixed in master. Please write back if it isn't!

tmcw avatar Aug 19 '16 16:08 tmcw