Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsEnginScriptError Converting circular structure to JSON TypeError: Converting circular structure to JSON #90

Open
MohaElder opened this issue Dec 15, 2018 · 5 comments

Comments

@MohaElder
Copy link

在使用wxCanvas的add方法后,在另一个函数里使用this.setData就会有这个报错:

VM3735:1 jsEnginScriptError
Converting circular structure to JSON
TypeError: Converting circular structure to JSON

小程序里出现的

@MohaElder
Copy link
Author

实测应该是浏览器内核问题,在小程序官方ide里面的chrome内核下出现问题。但是在真机上跑就ok

@zhaozhong
Copy link

我只要用到 this.wxCanvas = new wxDraw(context, 0, 0, '400', '300') 就会收到同样的错误,并且该错误影响后续一些 js 的执行,且所有 shape 都无法拖动

@MohaElder
Copy link
Author

找到问题所在了,在使用的时候我把所有的shape都放进了一个data里面的数组,只要把数组放到外面去直接用而不是this.setdata用就OK

@bobiscool bobiscool pinned this issue Dec 22, 2018
@MeiwahPat
Copy link

跟着例子用的,编译完就报错了,用的uniapp

@MeiwahPat
Copy link

我把wxCanvas从data挪到外面就行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants