Giter Site home page Giter Site logo

Comments (8)

yamalight avatar yamalight commented on May 13, 2024

Looks like this is due to parameter destruction, e.g.:

subscribe({topic, onNext, onError, onCompleted}) {
    return this.observe(topic).subscribe(onNext, onError, onCompleted);
}

from esdoc.

yamalight avatar yamalight commented on May 13, 2024

yep, so, this function:

observe({channel, topic}) {
    return this.channel(channel).observe(topic);
}

produces this tree:

{ kind: 'method',
  static: false,
  variation: null,
  name: 'observe',
  memberof: 'src/rxmq.js~Rxmq',
  longname: 'src/rxmq.js~Rxmq#observe',
  access: 'public',
  description: null,
  lineNumber: 17,
  undocument: true,
  params: [ { description: undefined } ],
  return: { types: [ '*' ], description: undefined },
  generator: false,
  ___id: 'T000002R000031',
  ___s: true }

and as you can see, params is complete wrong here.

Trying to figure out why and maybe create a PR.

from esdoc.

yamalight avatar yamalight commented on May 13, 2024

Interesting thing - if you manually create jsdoc that splits those params into single ones - it compiles OK

from esdoc.

h13i32maru avatar h13i32maru commented on May 13, 2024

@yamalight Hi! Thank you for this issue!

This is known ESDoc problem. 😓

With documentation tag, success to build documentation.

class Foo {
  /**
   * @param {{a: string, b: number, c: boolean}} myObject - this is my object.
   */
  method({a, b, c}){}
}

But if without documentation tag, occur problem to build documentation.

class Foo {
  method({a, b, c}){}
}

Now, workaround is to use Object Param Syntax.
I will want to fix this issue in next version.

from esdoc.

yamalight avatar yamalight commented on May 13, 2024

@h13i32maru yup, object params is exactly what I'd used so far.
thanks for quick response! 👍

from esdoc.

loopmode avatar loopmode commented on May 13, 2024

It's kind of hard to figure out where in your source code the problem arises.

If this is not easily fixed, please at least print some helpful information so users can figure out how to avoid the problem.
Any tips besides editing esdoc sources to log/debug?

I did exactly that, edited esdoc sources, to figure out.
For others who encounter such problems, here is how I did it.

In my case, the error was this:

D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\Publisher\Builder\DocBuilder.js:483
            throw _iteratorError2;
            ^

TypeError: Cannot read property 'indexOf' of undefined
    at IdentifiersDocBuilder._buildSignatureHTML (D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\Publisher\Builder\DocBuilder.js:1144:26)
    at D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\Publisher\Builder\DocBuilder.js:512:38
    at IceCap.loop (D:\Projects\NISV\source\client\client-core\node_modules\ice-cap\out\src\IceCap.js:261:9)
    at IdentifiersDocBuilder._buildSummaryDoc (D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\Publisher\Builder\DocBuilder.js:509:11)
    at IdentifiersDocBuilder._buildSummaryHTML (D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\Publisher\Builder\DocBuilder.js:468:29)
    at IdentifiersDocBuilder._buildIdentifierDoc (D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\Publisher\Builder\IdentifiersDocBuilder.js:77:40)
    at IdentifiersDocBuilder.exec (D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\Publisher\Builder\IdentifiersDocBuilder.js:52:32)
    at publish (D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\Publisher\publish.js:167:65)
    at Function.generate (D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\ESDoc.js:204:7)
    at ESDocCLI.exec (D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\ESDocCLI.js:90:28)

So, I edited node_modules\esdoc\out\src\Publisher\Builder\DocBuilder.js and placed this code in line 1144:

            if (!paramName) {
              console.warn('--------------------- CRASH LOG -----------------------');
              console.log(doc);
              console.warn('-------------------------------------------------------');
            }

and it helped me figure out the problematic sources:

--------------------- CRASH LOG -----------------------
{ __docId__: 3360,
  kind: 'function',
  static: true,
  variation: null,
  name: 'normalizeRangeAbs',
  memberof: 'src/mediaplayer/flux/helpers/assetRangeHelper.js',
  longname: 'src/mediaplayer/flux/helpers/assetRangeHelper.js~normalizeRangeAbs',
  access: 'public',
  export: true,
  importPath: 'client-core/src/mediaplayer/flux/helpers/assetRangeHelper.js',
  importStyle: '{normalizeRangeAbs}',
  description: null,
  lineNumber: 18,
  undocument: true,
  params:
   [ { description: undefined },
     { name: 'asset', types: [Object], description: undefined } ],
  return: { types: [ '*' ], description: undefined },
  generator: false,
  ___id: 'T000002R003362',
  ___s: true }
-------------------------------------------------------
D:\Projects\NISV\source\client\client-core\node_modules\esdoc\out\src\Publisher\Builder\DocBuilder.js:483
            throw _iteratorError2;
            ^

from esdoc.

alexandrricov avatar alexandrricov commented on May 13, 2024

I've got similar problem:

badge.svg
/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:483
            throw _iteratorError2;
            ^

TypeError: Cannot read property 'replace' of undefined
    at /usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:924:34
    at Array.map (native)
    at IdentifiersDocBuilder._buildTypeDocLinkHTML (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:919:41)
    at IdentifiersDocBuilder._buildSignatureHTML (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:1202:40)
    at /usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:512:38
    at IceCap.loop (/usr/local/lib/node_modules/esdoc/node_modules/ice-cap/out/src/IceCap.js:261:9)
    at IdentifiersDocBuilder._buildSummaryDoc (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:509:11)
    at IdentifiersDocBuilder._buildSummaryHTML (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:468:29)
    at IdentifiersDocBuilder._buildIdentifierDoc (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/IdentifiersDocBuilder.js:77:40)
    at IdentifiersDocBuilder.exec (/usr/local/lib/node_modules/esdoc/out/src/Publisher/Builder/IdentifiersDocBuilder.js:52:32)

added console log on 923 line

if (!tmp.length < 2) {
  console.warn('--------------------- CRASH LOG -----------------------');
  console.log(tmp);
  console.warn('-------------------------------------------------------');
}

and got log below

--------------------- CRASH LOG -----------------------
[ '*' ]
-------------------------------------------------------

hope it will be helpful

from esdoc.

h13i32maru avatar h13i32maru commented on May 13, 2024

Please check latest version.

from esdoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.