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

[CLOSED] Error Reading Preferences - not valid JSON #12034

Open
core-ai-bot opened this issue Aug 30, 2021 · 13 comments
Open

[CLOSED] Error Reading Preferences - not valid JSON #12034

core-ai-bot opened this issue Aug 30, 2021 · 13 comments

Comments

@core-ai-bot
Copy link
Member

Issue by milkymeda
Friday May 17, 2019 at 08:30 GMT
Originally opened as adobe/brackets#14792


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.

@core-ai-bot
Copy link
Member Author

Comment by shubhsnov
Friday May 17, 2019 at 08:39 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by milkymeda
Friday May 17, 2019 at 10:20 GMT


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"
    }
}

@core-ai-bot
Copy link
Member Author

Comment by sprintr
Friday May 17, 2019 at 12:52 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by milkymeda
Friday May 17, 2019 at 12:56 GMT


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"
    }
}

@core-ai-bot
Copy link
Member Author

Comment by marshalnosa
Saturday Nov 09, 2019 at 10:41 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by sprintr
Saturday Nov 09, 2019 at 10:53 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by marshalnosa
Sunday Nov 10, 2019 at 10:51 GMT


@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?

@core-ai-bot
Copy link
Member Author

Comment by saohlsen
Wednesday Nov 20, 2019 at 23:03 GMT


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,
}

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 21, 2019 at 03:01 GMT


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

"livedev.multibrowser": true

@core-ai-bot
Copy link
Member Author

Comment by saohlsen
Thursday Nov 21, 2019 at 15:33 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by pol1up
Saturday May 16, 2020 at 17:21 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by sk-ismail
Thursday Aug 20, 2020 at 18:46 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by justyb00
Thursday Mar 11, 2021 at 21:55 GMT


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 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

1 participant