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

settings.json cannot parse a file with BOM (Byte-Of-Mark) e.g. UTF-8 #5180

Closed
dotnetwise opened this issue Sep 15, 2015 · 4 comments
Closed

settings.json cannot parse a file with BOM (Byte-Of-Mark) e.g. UTF-8 #5180

dotnetwise opened this issue Sep 15, 2015 · 4 comments

Comments

@dotnetwise
Copy link

@dotnetwise dotnetwise commented Sep 15, 2015

This sounds silly, but spent already 30 min trying to figure out what's wrong with my settings.json file

@stubailo
Copy link
Contributor

@stubailo stubailo commented Sep 15, 2015

Please provide a full reproduction as described in: https://github.com/meteor/meteor/wiki/Contributing-to-Meteor#reporting-a-bug-in-meteor Without a way to replicate your problem, we can't debug and fix it.

Can you post an example settings.json file?

@dotnetwise
Copy link
Author

@dotnetwise dotnetwise commented Sep 15, 2015

even a blank settings.json file that contains UTF-8 BOM and curly braces is failing

{
}
@stubailo stubailo added the desired label Oct 23, 2015
@zol zol removed the desired label Feb 23, 2016
@abernix
Copy link
Member

@abernix abernix commented Dec 14, 2016

@hwillson
Copy link
Member

@hwillson hwillson commented Sep 5, 2017

I've confirmed this is still an issue with Meteor 1.5.2. Quick macos repro steps for this:

meteor create --bare meteor-issue-5180
cd meteor-issue-5180
printf '\xEF\xBB\xBF{"key": "value"}' > settings.json
meteor --settings=settings.json

leads to:

=> Started proxy.                             
=> Errors prevented startup:                  
   
   While preparing to run:
   settings.json: parse error reading settings file
   
=> Your application has errors. Waiting for file change.
=> Started MongoDB.
@hwillson hwillson self-assigned this Dec 8, 2017
hwillson added a commit to hwillson/meteor that referenced this issue Dec 11, 2017
The use of a byte order mark in a `--settings` file
crashes the Meteor Tool, when it attempts to JSON parse
the loaded settings data. Since a BOM is not required
(or recommended) when using UTF-8, this commit removes
it from the loaded settings data, before it is parsed.

Fixes meteor#5180.
benjamn added a commit that referenced this issue Dec 13, 2017
* Prevent Tool crash when settings file contains BOM

The use of a byte order mark in a `--settings` file
crashes the Meteor Tool, when it attempts to JSON parse
the loaded settings data. Since a BOM is not required
(or recommended) when using UTF-8, this commit removes
it from the loaded settings data, before it is parsed.

Fixes #5180.

* Add PR link to History.md

* Update History.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.