🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

TypeError: Cannot read property 'split' of undefined #301

Closed

Description

@damirka

Getting this error when trying to generate docs for multiple files.

Here is a log:

badge.svg
identifiers.html
index.html
class/components/redis/Connection.js~Connection.html
class/components/errors/DebugError.js~DebugError.html
class/components/errors/EmptyDataError.js~EmptyDataError.html
/usr/lib/node_modules/esdoc/out/src/Publisher/Builder/ClassDocBuilder.js:79
            throw _iteratorError;
            ^
TypeError: Cannot read property 'split' of undefined
    at /usr/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:1287:53
    at IceCap.loop (/usr/lib/node_modules/esdoc/node_modules/ice-cap/out/src/IceCap.js:261:9)
    at ClassDocBuilder._buildProperties (/usr/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:1285:11)
    at /usr/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:651:41
    at IceCap.loop (/usr/lib/node_modules/esdoc/node_modules/ice-cap/out/src/IceCap.js:261:9)
    at ClassDocBuilder._buildDetailDocs (/usr/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:606:11)
    at ClassDocBuilder._buildDetailHTML (/usr/lib/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:568:29)
    at ClassDocBuilder._buildClassDoc (/usr/lib/node_modules/esdoc/out/src/Publisher/Builder/ClassDocBuilder.js:172:44)
    at ClassDocBuilder.exec (/usr/lib/node_modules/esdoc/out/src/Publisher/Builder/ClassDocBuilder.js:64:36)
    at publish (/usr/lib/node_modules/esdoc/out/src/Publisher/publish.js:169:59)

And this is my config:

{
  "access": ["public", "protected", "private"],
  "source": "./app/components",
  "destination": "./out/esdoc",
  "undocumentIdentifier": true,
  "unexportIdentifier": true,
  "autoPrivate": false,
  "lint": false
}

Activity

  1. moroine commented on Jun 23, 2016

    @moroine

    Same issue on my side

  2. damirka commented on Jun 23, 2016

    @damirka
    Author

    To @moroine:

    I've found a way to fix this but it's completely incorrect and weird. Just added this condition:

    // in /usr/lib/node_modules/esdoc/out/Publisher/Builder/DocBuilder#1288
    if (prop.name === undefined) {
        return ice;
    }

    If you need a quick fix to generate docs - this can work. But I don't recommend to do it in any other case.

    UPD: There's an ice.loop('property', properties, function (i, prop, ice) { ... }) block and in some cases (I didn't go further) prop can be an empty object or smth. So the name property is undefined.

    It's funny that I've been migrating from JSDoc and after I removed some JSDoc tags (as I see now) it began to work properly even without this fix. 🎱

  3. make-github-pseudonymous-again commented on Nov 2, 2016

    @make-github-pseudonymous-again

    Here's an example that throws a similar error

    export class Product {
    
        constructor ( a , b ) {
            this.a = a ;
            this.b = b ;
        }
    
        zero ( ) {
            return [ this.a.zero( ) , this.b.zero( ) ] ;
        }
    
        plus ( [ a , b ] , [ A , B ] ) {
            return [ this.a.plus( a , A ) , this.b.plus( b , B ) ] ;
        }
    
    }

    Commenting out the plus method or adding

        /**
         * @param first
         * @param second
         */

    just before the plus method makes esdoc work again.

  4. damirka commented on Nov 2, 2016

    @damirka
    Author

    Seems to me it's somehow related to destructive assignment and it's parsing. Did you try any other ways?

    // like this one
    function example({ a: A, b: B }, c = null, [ d = null ]) {
      // check params inside
    }
  5. make-github-pseudonymous-again commented on Nov 2, 2016

    @make-github-pseudonymous-again

    No but I think your guess is correct.

  6. h13i32maru commented on Dec 27, 2016

    @h13i32maru
    Member

    Thanks for this report.

    I will fix this bug in next version.

  7. added this to the next-version milestone on Dec 27, 2016
  8. h13i32maru commented on Dec 27, 2016

    @h13i32maru
    Member

    I fixed this bug.
    c8ae3f5

    And will release in next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions