Skip to content

TypeError: Cannot read property 'longname' of null #1416

@alexisab

Description

@alexisab

I try to setup jsdoc in my project. I've write some simple comments but when I run jsdoc i got this error :

/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/parser.js:360
        result.memberof = doclet.longname + jsdoc.name.SCOPE.PUNC.INSTANCE;
                                ^

TypeError: Cannot read property 'longname' of null
    at exports.Parser.Parser.astnodeToMemberof (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/parser.js:360:33)
    at addSymbolMemberof (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/handlers.js:252:31)
    at newSymbolDoclet (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/handlers.js:282:13)
    at exports.Parser.<anonymous> (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/handlers.js:349:13)
    at emitTwo (events.js:106:13)
    at exports.Parser.emit (events.js:192:7)
    at exports.Visitor.Visitor.visitNode (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/visitor.js:566:16)
    at exports.Visitor.Visitor.visit (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/visitor.js:468:27)
    at exports.Walker.Walker.recurse (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/walker.js:699:38)
    at exports.Parser.Parser._walkAst (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/parser.js:265:18)
    at exports.Parser.Parser._parseSourceCode (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/parser.js:256:18)
    at exports.Parser.Parser.parse (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/lib/jsdoc/src/parser.js:179:18)
    at Object.module.exports.cli.parseFiles (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/cli.js:370:42)
    at module.exports.cli.main (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/cli.js:239:14)
    at Object.module.exports.cli.runCommand (/home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/cli.js:189:5)
    at /home/alexis/Documents/programmation/clovis/client/node_modules/jsdoc/jsdoc.js:105:9
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Here is my config file :

{
    "plugins": [],
    "recurseDepth": 3,
    "source": {
        "include": [ "src" ],
        "includePattern": ".+\\.js(doc|x)?$",
        "excludePattern": "(^|\\/|\\\\)_"
    },
    "sourceType": "module",
    "tags": {
        "allowUnknownTags": true,
        "dictionaries": ["jsdoc","closure"]
    },
    "templates": {
        "cleverLinks": false,
        "monospaceLinks": false
    },
    "opts": {
        "template": "node_modules/docdash",
        "destination": "./doc/",
        "readme": "./README.md",
        "verbose": true,
        "recurse": true
    }
}

I run this command (in my package.json, but I got the same error if I use directly jsdoc bin):

jsdoc -c .jsdoc.json

If I remove the recurse option it works 😕

I'm on ubuntu 16.04,
Node v7.6.0
Yarn 0.27.5
jsdoc 3.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions