初学者请教Expecting 'STRING', got }怎么解决?
发布于 6 年前 作者 xiuyingchang 10756 次浏览 来自 问答

代码如下:

{

 “pages”: [

    “pages/index/index”

  ],

  “window”: {

    “backgroundTextStyle”: “light”,

    “navigationBarBackgroundColor”: “#fff”,

    “navigationBarTitleText”: “WeChat”,

    “navigationBarTextStyle”: “black”

  },

}

出错如下:undefined
Expecting ‘STRING’, got }
   8 |     “navigationBarTitleText”: “WeChat”,
   9 |     “navigationBarTextStyle”: “black”
> 10 |   },
     |   ^
  11 | }
  12 |请问这个哪里有问题呀?

4 回复

下面没有新的配置信息就不要加逗号

不然编译器认为你没写完

我的错误如下,如何解决呢?

Error: Expecting ‘STRING’,‘NUMBER’,‘NULL’,‘TRUE’,‘FALSE’,’{’,’[’, got INVALID


1 | {


2 | “pages”: [


3 | “pages/index/index”

这里不能由逗号

要学会看报错信息   报错提示很明显的

回到顶部