Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

TypeError: Cannot read property 'name' of null #33

Closed
MetaMemoryT opened this issue Sep 26, 2014 · 2 comments
Closed

TypeError: Cannot read property 'name' of null #33

MetaMemoryT opened this issue Sep 26, 2014 · 2 comments

Comments

@MetaMemoryT
Copy link
Contributor

was trying to parse this file: https://gist.github.com/MetaMemoryT/e9b98d89c62ec7aec5a1

and got an error that was not very descriptive

it would be nice if it would tell what line of the input file it failed at

$ /c/nodejs/node_modules/tern/bin/condense --name "sqljs-substring" --plugin /c/Users/Sean/s/eclipse-luna/eclipse-standard-luna-R-win32-x86_64/eclipse/plugins/tern.core_ 0.6.0.201409182110/node_modules/tern/node_modules/tern-closure/closure.js --def helpers.json sql.js/coffee/api.js > sqljs-substring.json
C:\Users\Sean\s\eclipse-luna\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\tern.core_0.6.0.201409182110\node_modules\tern\node_modules\tern-closure\node_modules\doctrine\doctrine.js:1761
                    if (isParamTitle(this._title) && this._tag.type.name) {
                                                                   ^
TypeError: Cannot read property 'name' of null
    at TagParser.parseName (C:\Users\Sean\s\eclipse-luna\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\tern.core_0.6.0.201409182110\node_modules\tern\node_modules\tern-closure\node_modules\doctrine\doctrine.js:1761:68)
    at TagParser.parse (C:\Users\Sean\s\eclipse-luna\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\tern.core_0.6.0.201409182110\node_modules\tern\node_modules\tern-closure\node_modules\doctrine\doctrine.js:1976:34)
    at parseTag (C:\Users\Sean\s\eclipse-luna\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\tern.core_0.6.0.201409182110\node_modules\tern\node_modules\tern-closure\node_modules\doctrine\doctrine.js:1999:27)
    at Object.parse (C:\Users\Sean\s\eclipse-luna\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\tern.core_0.6.0.201409182110\node_modules\tern\node_modules\tern-closure\node_modules\doctrine\doctrine.js:2071:23)
    at Comment.parse (C:\Users\Sean\s\eclipse-luna\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\tern.core_0.6.0.201409182110\node_modules\tern\node_modules\tern-closure\lib\comment.js:40:26)
    at interpretComments (C:\Users\Sean\s\eclipse-luna\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\tern.core_0.6.0.201409182110\node_modules\tern\node_modules\tern-closure\closure.js:209:11)
    at walk.simple.AssignmentExpression (C:\Users\Sean\s\eclipse-luna\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\tern.core_0.6.0.201409182110\node_modules\tern\node_modules\tern-closure\closure.js:172:7)
    at c (C:\Users\Sean\s\eclipse-luna\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\tern.core_0.6.0.201409182110\node_modules\tern\node_modules\acorn\util\walk.js:30:18)
    at Object.skipThrough (C:\nodejs\node_modules\tern\node_modules\acorn\util\walk.js:163:39)
    at c (C:\Users\Sean\s\eclipse-luna\eclipse-standard-luna-R-win32-x86_64\eclipse\plugins\tern.core_0.6.0.201409182110\node_modules\tern\node_modules\acorn\util\walk.js:29:17)
@jgiles jgiles closed this as completed in 2b52dd4 Sep 29, 2014
@jgiles
Copy link
Contributor

jgiles commented Sep 29, 2014

Thanks for the crash report!
I've added some extra error output, so that you can identify the JSDoc comments causing these parse errors.
In the case of your api.js, Doctrine (the JSDoc parser) didn't seem to like your @param tags. They don't really look like normal JSDoc tags to me either - we target the style used by the Closure compiler, which among other things uses curly braces for tags (e.g. @param {string}).

@MetaMemoryT
Copy link
Contributor Author

Thanks, that looks great.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants