Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the exact error message of JsDoc in reactjs?

Tags:

reactjs

jsdoc

We are using JsDoc to create our document of reactjs pages. All comment we wrote as per the jsDoc rule but still it showing below message for some page:

ERROR: Unable to parse D:\Example\src\reducers\example.js:Unexpected token

I am not getting the error in other pages, we wrote the comment same way but for some pages it is throwing above error. How can I get the exact error message and line number where it is failing?

like image 809
Gorakh Nath Avatar asked Jun 08 '17 09:06

Gorakh Nath


1 Answers

How can I get the exact error message and line number where it is failing?

Command-line arguments to JSDoc provide --verbose option which should provide with log detailed information as JSDoc runs. Unfortunately this will not give you exact line number.

What you ask is available as the open request on GitHub: Option to print error stack. As you may guess this is not implemented yet. You may use work around, which posted by iPherian in the same thread. This work around will give you line number and column of the error occur.

EDIT:

As of jsdoc version "3.5.0-dev" (current development master) the feature to print line and column number of error occur is implemented and available. After installation of the current development version ...

npm install git+https://github.com/jsdoc3/jsdoc.git

and running jsdoc against JS source

>"C:\folder\node_modules\.bin\jsdoc.cmd" AppScripts -d bin/Reference --verbose

the error along with line and column numbers are printed out into the output ...

enter image description here

like image 138
Slava Ivanov Avatar answered Oct 22 '22 09:10

Slava Ivanov