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

Error Reading Preferences - not valid JSON #14792

Closed
spondec opened this issue May 17, 2019 · 13 comments
Closed

Error Reading Preferences - not valid JSON #14792

spondec opened this issue May 17, 2019 · 13 comments

Comments

@spondec
Copy link

spondec commented May 17, 2019

I'm trying to change the PHP "executablePath" in order to get PHP Tooling support and I got this error:

Your preferences file is not valid JSON. Please fix the format.

Here is my brackets.json:

 {
    "brackets-eslint.gutterMarks": true,
    "brackets-eslint.useLocalESLint": false,
    "fonts.fontSize": "13px",
    "fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
    "themes.theme": "monokai-plus-theme",
    "livedev.multibrowser": false,
    "useTabChar": false,
    "themes.themeScrollbars": true,
    "extensions.sort": "downloadCount"
    "php": {
		// Default: true
		"enablePhpTooling": true,

		// Default: php
		"executablePath": "C:\xampp\php\php.exe",

		// Default: 4095M
		"memoryLimit": "4095M",

		// Default: false
		"validateOnType": "true"
	},
}

I've tried different things like adding only this line, with/without the comma etc.

"executablePath": "C:\xampp\php\php.exe",

But none of them worked. What could be the problem?

Thank you.

@shubhsnov
Copy link
Collaborator

shubhsnov commented May 17, 2019

You can't have comments in brackets.json. Removing them should fix it.
You can refer to this in case you have any doubts. #14783
Let us know if there are still any issues you face.

@spondec
Copy link
Author

spondec commented May 17, 2019

Unfortunately, it did not work. Here is the current state of brackets.json:

{
    "brackets-eslint.gutterMarks": true,
    "brackets-eslint.useLocalESLint": false,
    "fonts.fontSize": "13px",
    "fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
    "themes.theme": "monokai-plus-theme",
    "livedev.multibrowser": false,
    "useTabChar": false,
    "themes.themeScrollbars": true,
    "extensions.sort": "downloadCount",
    "php": {
    "executablePath": "C:\xampp\php\php.exe",
    "validateOnType": "true"
    }
}

@sprintr
Copy link
Contributor

sprintr commented May 17, 2019

@Milkymeda You have to put executablePath like such "C:\\xampp\\php\\php.exe" to escape backslash.

@spondec
Copy link
Author

spondec commented May 17, 2019

That worked! Thanks a lot!

{
    "brackets-eslint.gutterMarks": true,
    "brackets-eslint.useLocalESLint": false,
    "fonts.fontSize": "13px",
    "fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
    "themes.theme": "monokai-plus-theme",
    "livedev.multibrowser": false,
    "useTabChar": false,
    "themes.themeScrollbars": true,
    "extensions.sort": "downloadCount",
    "php": {
    "executablePath": "C:\\xampp\\php\\php.exe",
    "validateOnType": "true"
    }
}

@spondec spondec closed this as completed May 17, 2019
@marshalnosa
Copy link

That worked! Thanks a lot!

{
    "brackets-eslint.gutterMarks": true,
    "brackets-eslint.useLocalESLint": false,
    "fonts.fontSize": "13px",
    "fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
    "themes.theme": "monokai-plus-theme",
    "livedev.multibrowser": false,
    "useTabChar": false,
    "themes.themeScrollbars": true,
    "extensions.sort": "downloadCount",
    "php": {
    "executablePath": "C:\\xampp\\php\\php.exe",
    "validateOnType": "true"
    }
}

I am having same issue here and I added this code but my Brackets still having the issue of resetting itself after lunching.

I still get the default theme and font size whenever I restart.

Secondly, it still takes me to this JSON error page instead of my previous project.

Any help on how to solve this?

Thanks

image

@sprintr
Copy link
Contributor

sprintr commented Nov 9, 2019

@marshalnosa Have you used valid JSON? Can you share your preferences.json?

@marshalnosa
Copy link

@marshalnosa Have you used valid JSON? Can you share your preferences.json?

@sprintr, I can't find the preference.json file here.

How do I go about that?

@saohlsen
Copy link

Hi,
Getting "error reading preferences" - "Your preferences file is not valid JSON."

Anyone know what is wrong with it ?

{
"brackets-eslint.gutterMarks": true,
"brackets-eslint.useLocalESLint": false,
"fonts.fontSize": "14px",
"fonts.fontFamily": "hack, 'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
"themes.theme": "os-x-style-flat-dark-theme",
"useTabChar": true,
"tabSize": 3,
"linting.collapsed": true,
"linting.ESLint.collapsed": false,
"linting.JSLint.collapsed": true,
"livedev.multibrowser": true,
}

@redmunds
Copy link
Contributor

@saohlsen I think you need to remove the trailing comma from the last line:

"livedev.multibrowser": true

@saohlsen
Copy link

@redmunds @ oh boy! Thank you, it works.

@pol1up
Copy link

pol1up commented May 16, 2020

I have a similar problem...

"brackets-eslint.gutterMarks":` true,
"brackets-eslint.useLocalESLint": false,
"fonts.fontSize": "12px",
"fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
"themes.theme": "monokai-darkness-reborn",

I am still getting an error

@sk-ismail
Copy link

There is an error in first line...
"brackets-eslint.gutterMarks":` true,
you have to remove that single invited comma in front of true

@justyb00
Copy link

I have a similar problem...
{
    "brackets-eslint.gutterMarks": true,
    "brackets-eslint.useLocalESLint": false,
    "fonts.fontSize": "12px",
    "fonts.fontFamily": "'SourceCodePro-Medium', MS ゴシック, 'MS Gothic', monospace",
    "linting.ESLint.collapsed": false,
    "linting.collapsed": true,
    "externalApplications": {
        "jpg": "D:\\Apps\\IrfanView\\i_view64.exe",
        "jpeg": "D:\\Apps\\IrfanView\\i_view64.exe",
        "png": "D:\\Apps\\IrfanView\\i_view64.exe",
        "svg": "C:\\Program Files\\Internet Explorer\\iexplore.exe",
        "psd": "D:\\Apps\\IrfanView\\i_view64.exe",
        "php": {
        "enablePhpTooling": true,
        "executablePath": "C:\\Apps\\scoped_dir3768_943626505\\OpenServer\\modules\\php\\PHP_7.4\\php.exe",
        "memoryLimit": "4095M",
        "validateOnType": "false"
        }
    }
}

but PHP runtime doesn't work.
image

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

10 participants