You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS Code settings.json添加自定义CSS时提示end of file expected报错如何解决

VS Code settings.json 报错解决方法

错误原因

合法JSON文件仅允许存在一个根对象,你将原有配置和新增配置用两个独立的{}包裹,相当于在一个JSON文件里定义了两个根对象,因此编辑器会在第二个对象的起始{位置抛出「end of file expected」错误。

修正方案

将新配置项合并到原有根对象内即可,完整的正确配置如下:

{
    "workbench.colorTheme": "Synthwave x Fluoromachine",
    "security.workspace.trust.enabled": false,
    "synthwave84.brightness": 1,
    "workbench.iconTheme": "sweet-vscode-icons",
    "cyber77.brightness": 1,
    "emmet.syntaxProfiles": {
    },
    "vscode_custom_css.imports": [
        "file:///C:/Users/User/.vscode/extensions/webrender.synthwave-x-fluoromachine-0.0.12/synthwave-x-fluoromachine.css"
    ]
}

额外注意事项

  • JSON所有标点必须使用英文半角格式
  • 同一层级的配置项之间必须用英文逗号分隔
  • 同一层级的最后一个配置项末尾不能加逗号

内容的提问来源于stack exchange,提问作者Shyft

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.01 16:24:05