[GH-ISSUE #54] Install script crashes if settings.json contains comments #42

Closed
opened 2026-05-06 13:12:54 +02:00 by BreizhHardware · 1 comment

Originally created by @kurisubrooks on GitHub (Feb 17, 2026).
Original GitHub issue: https://github.com/bwya77/vscode-dark-islands/issues/54

When running the install script, the script crashes at Step 4. due to the presence of comments (//) in the settings.json. Despite VS Code supporting comments in JSON, it appears you're using Node's built-in JSON.parse, which does not.

settings.json (relevant lines)

{
  ...
  "workbench.colorCustomizations": {
    "terminal.background": "#00000000"
    // "editor.background": "#fefdf8",
    // "editorGutter.background": "#fefdf8"
  },
  ...
}

Crash:

❯ curl -fsSL https://raw.githubusercontent.com/bwya77/vscode-dark-islands/main/bootstrap.sh | bash
# [...truncated...]

⚙️  Step 4: Applying VS Code settings...
⚠️  Existing settings.json found
   Backing up to settings.json.backup
   Merging Islands Dark settings with your existing settings...
<anonymous_script>:198
    // "editor.background": "#fefdf8",
    ^

SyntaxError: Expected ',' or '}' after property value in JSON at position 5131 (line 198 column 5)
    at JSON.parse (<anonymous>)
    at [stdin]:27:31
    at runScriptInThisContext (node:internal/vm:219:10)
    at node:internal/process/execution:451:12
    at [stdin]-wrapper:6:24
    at runScriptInContext (node:internal/process/execution:449:60)
    at evalFunction (node:internal/process/execution:283:30)
    at evalTypeScript (node:internal/process/execution:295:3)
    at node:internal/main/eval_stdin:51:5
    at Socket.<anonymous> (node:internal/process/execution:205:5)

Node.js v25.2.1
Originally created by @kurisubrooks on GitHub (Feb 17, 2026). Original GitHub issue: https://github.com/bwya77/vscode-dark-islands/issues/54 When running the install script, the script crashes at Step 4. due to the presence of comments (`//`) in the settings.json. Despite VS Code supporting comments in JSON, it appears you're using Node's built-in `JSON.parse`, which does not. settings.json (relevant lines) ```jsonc { ... "workbench.colorCustomizations": { "terminal.background": "#00000000" // "editor.background": "#fefdf8", // "editorGutter.background": "#fefdf8" }, ... } ``` Crash: ```bash ❯ curl -fsSL https://raw.githubusercontent.com/bwya77/vscode-dark-islands/main/bootstrap.sh | bash # [...truncated...] ⚙️ Step 4: Applying VS Code settings... ⚠️ Existing settings.json found Backing up to settings.json.backup Merging Islands Dark settings with your existing settings... <anonymous_script>:198 // "editor.background": "#fefdf8", ^ SyntaxError: Expected ',' or '}' after property value in JSON at position 5131 (line 198 column 5) at JSON.parse (<anonymous>) at [stdin]:27:31 at runScriptInThisContext (node:internal/vm:219:10) at node:internal/process/execution:451:12 at [stdin]-wrapper:6:24 at runScriptInContext (node:internal/process/execution:449:60) at evalFunction (node:internal/process/execution:283:30) at evalTypeScript (node:internal/process/execution:295:3) at node:internal/main/eval_stdin:51:5 at Socket.<anonymous> (node:internal/process/execution:205:5) Node.js v25.2.1 ```
Author
Owner

@bwya77 commented on GitHub (Feb 19, 2026):

Fixed in v.0.0.2

<!-- gh-comment-id:3928323813 --> @bwya77 commented on GitHub (Feb 19, 2026): Fixed in v.0.0.2
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vscode-dark-islands#42
No description provided.