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

SyntaxError: Expected double-quoted property name in JSON #215399

Closed
jojorne opened this issue Jun 13, 2024 · 6 comments
Closed

SyntaxError: Expected double-quoted property name in JSON #215399

jojorne opened this issue Jun 13, 2024 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@jojorne
Copy link

jojorne commented Jun 13, 2024

Type: Bug

Open a brand new Visual Studio Code:

[info] update#setState idle
[error] SyntaxError: Expected double-quoted property name in JSON at position 158 (line 20 column 1)
    at JSON.parse (<anonymous>)
    at bt.Y (C:\Program Files\Microsoft VS Code\resources\app\out\vs\code\electron-main\main.js:110:71146)
[warning] updateWindowsJumpList#setJumpList unexpected result: customCategoryAccessDeniedError

VS Code version: Code 1.90.0 (89de5a8, 2024-06-04T19:33:54.889Z)
OS version: Windows_NT x64 10.0.22631
Modes:

@aeschli
Copy link
Contributor

aeschli commented Jun 13, 2024

Can you check if your argv.json file has a syntax error? It's in your home folder at .vscode\

The failing parse statement is here:

const argvJSON = JSON.parse(stripComments(argvString));

@bpasero Would be good to have better error reporting for malformed arg.json files.

@aeschli aeschli assigned bpasero and unassigned aeschli Jun 13, 2024
@bpasero
Copy link
Member

bpasero commented Jun 13, 2024

/duplicate #212671

@vscodenpa vscodenpa added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 13, 2024
@vscodenpa
Copy link

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2024
@bpasero
Copy link
Member

bpasero commented Jun 13, 2024

@aeschli is there a way to safely parse a JSON with comments and syntax errors?

@jojorne
Copy link
Author

jojorne commented Jun 13, 2024

This is my ~\.vscode\argv.json.

// This configuration file allows you to pass permanent command line arguments to VS Code.
// Only a subset of arguments is currently supported to reduce the likelihood of breaking
// the installation.
//
// PLEASE DO NOT CHANGE WITHOUT UNDERSTANDING THE IMPACT
//
// NOTE: Changing this file requires a restart of VS Code.
{
	// Use software rendering instead of hardware accelerated rendering.
	// This can help in cases where you see rendering issues in VS Code.
	"disable-hardware-acceleration": true,

	// Allows to disable crash reporting.
	// Should restart the app if the value is changed.
	"enable-crash-reporter": false,

	// Unique id used for correlating crash reports sent from this instance.
	// Do not edit this value.
	"crash-reporter-id": "00000000-0000-0000-0000-000000000000",
}

I can only think about the last ,.

...And, yes! After removing the trailing ,:

[info] update#setState idle
[warning] updateWindowsJumpList#setJumpList unexpected result: customCategoryAccessDeniedError

@aeschli
Copy link
Contributor

aeschli commented Jun 14, 2024

@bpasero Our own JSON parser is fault tolerant and can also handle comments and extra semicolons.

I've seen that we have multiple places in the code base where we read and parse argv.json. Would be good to share that code.

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jul 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

4 participants