Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash esdoc-accessor-plugin "Cannot read property 'charAt' of null" #28

Open
lll000111 opened this issue Sep 20, 2017 · 3 comments
Open

Comments

@lll000111
Copy link

.\one\node_modules\esdoc-accessor-plugin\src\Plugin.js:16
        if (autoPrivate && doc.name.charAt(0) === '_') {
                                   ^

TypeError: Cannot read property 'charAt' of null
    at Plugin.onHandleDocs (.\one\node_modules\esdoc-accessor-plugin\src\Plugin.js:16:36)
    at Plugin._execHandler (.\one\node_modules\esdoc\out\src\Plugin\Plugin.js:55:26)
    at Plugin.onHandleDocs (.\one\node_modules\esdoc\out\src\Plugin\Plugin.js:135:10)
    at Function.generate (.s\one\node_modules\esdoc\out\src\ESDoc.js:133:32)
    at ESDocCLI.exec (.\one\node_modules\esdoc\out\src\ESDocCLI.js:71:23)
    at Object.<anonymous> (.\one\node_modules\esdoc\out\src\ESDocCLI.js:182:7)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
@vihanb
Copy link

vihanb commented Oct 13, 2017

This seems to happen if you have a@typedef {T} but don't specify a name

@alexdiliberto
Copy link

alexdiliberto commented Sep 1, 2018

Also seeing this if I use a class field which has a dasherized name;

export default class MyComponent {
	/* I am a prop */
	'my-prop': 123;
}

doc.name will be undefined in this case and the Plugin will throw the TypeError

@DanielRuf
Copy link

undefined !== null

Simply change it to if (autoPrivate && doc.name && doc.name.charAt(0) === '_') {

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

Successfully merging a pull request may close this issue.

4 participants