首页 > 解决方案 > 意图处理程序失败并出现错误:位置 1 处 JSON 中的意外标记 o

问题描述

当我更新@google/local-home-sdk到时1.1.0,构建代码并部署到 firebase。配置如下:

{
 "dependencies": {
    "@google/local-home-sdk": "^1.1.0",
    "array.prototype.flatmap": "^1.2.3",
    "cbor": "^5.0.2",
    "opc": "^1.1.3",
    "xmldom": "^0.3.0",
    "crypto-js": "^3.2.0"
  },
  "devDependencies": {
    "ava": "^2.1.0",
    "c8": "^5.0.1",
    "firebase-tools": "^8.1.1",
    "html-webpack-plugin": "^3.2.0",
    "ts-loader": "^6.0.2",
    "ts-node": "^8.2.0",
    "tslint": "^5.17.0",
    "typescript": "^3.5.1",
    "webpack": "^4.32.2",
    "webpack-cli": "^3.3.2",
    "webpack-dev-server": "^3.5.1"
  }
}

当我在本地控制设备时,会发生错误:

smarthome_sdk.js:135  [  4.162s] [smarthome.DeviceManager] Intent handler failed with error: Unexpected token o in JSON at position 1 

smarthome_sdk.js:135  [  4.168s] [smarthome.DeviceManager] Got a rejected promise Unexpected token o in JSON at position 1 

为什么?有什么我想念的设置吗?

谢谢你。BR,杰​​克利

标签: typescript

解决方案


推荐阅读