保存具有Parse.files数组的Javascript对象会导致“将循环结构转换为JSON".错误 [英] Saving Javascript object that has an array of Parse.files causes "Converting circular structure to JSON" error

查看:65
本文介绍了保存具有Parse.files数组的Javascript对象会导致“将循环结构转换为JSON".错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试上传一组要解析的解析文件时,我遇到了parse.com不喜欢它的问题.

I'm running into a problem where parse.com doesn't like it when I try to upload an array of parse files to parse.

我目前有一个用base64字符串图像数据填充的数组(arr)

I currently have an array (arr) that is filled with base64 string image data

for (var i=0; i<arr.length; i++){
    var pfile = new Parse.File("photo", { base64: arr[i] });
    pfile.save();
    parseArr.push(pfile);
}

当我尝试将数组保存到名为"images"的列以解析parse.com数据浏览器时,我遇到错误:

When I attempt to save the array to a column called "images" to parse.com data browser, I run into an error:

posts.set("images", parseArr)

我最终遇到此错误

TypeError: Converting circular structure to JSON
    at Object.stringify (native)
    at _.extend._resetCacheForKey (../node_modules/parse/build/parse-latest.js:4957:25)

我是否可以上传多张照片,这些照片将显示在parse.com的一栏中? 这是parse.com问题的存档部分,但它们需要更改源代码才能解决该问题.

Is there anyway I can upload multiple photos that will show up in one column in parse.com? Here's an archived section of parse.com's question but they require a change in the source code to circumvent the problem.

参考parse.com存档问题论坛

帮助?

推荐答案

最终更新:好消息!已进行修复,并将在下一Javascript SDK版本1.6.0中发布.

Final Update: Good news! A fix has been made and will be released in the next Javascript SDK release 1.6.0.

这篇关于保存具有Parse.files数组的Javascript对象会导致“将循环结构转换为JSON".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆