WEEX 报错 TypeError: Converting circular structor to JSON 的解决方法

简介: 在进行千牛QAP插件开发的时候,有时会遇到 TypeError: Converting circular structor to JSON,并且看不到报错位置,对新手可能会造成疑惑。

背景

在进行千牛QAP插件开发的时候,有时会遇到 TypeError: Converting circular structor to JSON,并且看不到报错位置,对新手可能会造成疑惑。

原因

weex(rax)的js代码运行在js环境,跟native端通信的时候只能用字符串,如果js跟native通讯的时候,传送了不能转换为字符串的对象,那么就会报错,比如function,weex的console.log方法最终是调用了natvie的log方法,如果给这个方法的参数包含函数或者不合法的json时,那么就会触发Converting circular structor to JSON 的报错。

另外weex 的console.group方法不支持,
加入了console.group在debugger模式的时候不报错,但是在native下就会报错,原因是debugger下,用的是chrome的console方法,所以不会有问题。

解决方法

检查页面所有console.log的方法,是不是传入了函数或者其他非法字符。删掉以后一般就会正常。

目录
相关文章
|
5月前
|
资源调度 JavaScript Windows
yarn install命令报错解决办法-warning package-lock.json found.
yarn install命令报错解决办法-warning package-lock.json found.
97 0
|
12月前
|
JSON 边缘计算 数据格式
KubeEdge安装加入边缘节点报错: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into
KubeEdge安装加入边缘节点报错: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal number into
199 0
|
4月前
|
JSON 数据格式
解决报错TypeError: Converting circular structure to JSON --> starting at object with constructor
解决报错TypeError: Converting circular structure to JSON --> starting at object with constructor
|
2月前
|
SQL 消息中间件 Java
Flink报错问题之使用debezium-json format报错如何解决
Apache Flink是由Apache软件基金会开发的开源流处理框架,其核心是用Java和Scala编写的分布式流数据流引擎。本合集提供有关Apache Flink相关技术、使用技巧和最佳实践的资源。
|
2月前
|
SQL Java 关系型数据库
flink问题之使用debezium-json format报错如何解决
Apache Flink是由Apache软件基金会开发的开源流处理框架,其核心是用Java和Scala编写的分布式流数据流引擎。本合集提供有关Apache Flink相关技术、使用技巧和最佳实践的资源。
48 0
|
3月前
|
JSON 数据格式 Python
TypeError the JSON object must be str, bytes or bytearray, not ‘list‘
TypeError the JSON object must be str, bytes or bytearray, not ‘list‘
|
4月前
|
小程序 API 定位技术
【uni-app报错】选择地址:fail the api need to be declared in the requiredPrivateInfos field in app/ext.json
【uni-app报错】选择地址:fail the api need to be declared in the requiredPrivateInfos field in app/ext.json
106 0
|
JSON 数据格式
解决POSTMAN传参报错,JSON parse error: Cannot deserialize instance of `java.util.ArrayList` out of START_OB
解决POSTMAN传参报错,JSON parse error: Cannot deserialize instance of `java.util.ArrayList` out of START_OB
解决POSTMAN传参报错,JSON parse error: Cannot deserialize instance of `java.util.ArrayList` out of START_OB
|
7月前
|
缓存 PHP
Composer require 报错 reverting ./composer.json and ./composer.lock to ...
Composer require 报错 reverting ./composer.json and ./composer.lock to ...
90 1
|
8月前
|
JSON 数据格式
40【软件基础】newtonsoft JSON使用报错:当前上下文中不存在名称“JsonConvert”
库文件也加了,命名空间也引用了,可还是不能用。 原因可能是:.Net FrameWork框架必须是4.5及以上。
112 0