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

Cannot parse the config file #1297

Closed
MFry opened this issue Dec 8, 2016 · 4 comments
Closed

Cannot parse the config file #1297

MFry opened this issue Dec 8, 2016 · 4 comments

Comments

@MFry
Copy link

MFry commented Dec 8, 2016

I am running jsdoc on windows 7

$ jsdoc -v
JSDoc 3.4.3 (Thu, 10 Nov 2016 00:25:10 GMT)

and trying to run the documentations config file leads, which leads to the following:

$ jsdoc -c jsdocs.config
Cannot parse the config file jsdocs.config: SyntaxError: Unexpected token  in JSON at position 0
Exiting JSDoc because an error occurred. See the previous log messages for details.

The config file is the one used as an example on the site:
https://github.com/jsdoc3/jsdoc/blob/master/conf.json.EXAMPLE

@hegemonic
Copy link
Contributor

I strongly suspect that you're saving the config file as UTF-8 with a BOM at the beginning. Try saving it in a different text encoding, or without the BOM.

@MFry
Copy link
Author

MFry commented Dec 12, 2016

Thanks for pointing me to the problem @hegemonic . Here is a quick writeup/solution to the problem.

Explanation:
Windows tends to encode using utf-8 with BOM and you can check/modify the encoding with notepad or notepad++.

Solution:
Change to utf-8 without BOM for jsdoc. Take care with software such as visual studios which will change the format back by default when you hit save.

The issue is related to:
Reference
github.com/nodejs/1918
#1256

@johnfercher
Copy link

@MFry , how can I convert to utf-8 without BOM in Linux 16.04?

@hegemonic
Copy link
Contributor

FYI, this is now fixed on master. The fix will be included in JSDoc 3.5.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

No branches or pull requests

3 participants