使用FormData.append()会引发错误

时间:2017-09-16 12:28:54

标签: react-native redux fetch redux-saga

在我的redux-saga内,我正在进行一个需要formdata作为正文的提取调用。

const formdata = new FormData();
var blob = new Blob(['test'],{})
formdata.append('file', blob);

然而,这会引发错误

TypeError: One of the sources for assign has an enumerable key on the prototype chain. Are you trying to assign a prototype property? We don't allow it, as this is an edge case that we do not support. This error is a performance optimization and not spec compliant.
    at Object.assign (Object.es6.js:55)
    at FormData.js:81
    at Array.map (<anonymous>)
    at FormData.getParts (FormData.js:65)
    at convertRequestBody (convertRequestBody.js:31)
    at RCTNetworking.sendRequest (RCTNetworking.ios.js:39)
    at XMLHttpRequest.send (XMLHttpRequest.js:495)
    at fetch.js:462
    at tryCallTwo (core.js:45)
    at doResolve (core.js:200)

这也发生在另外两个我试图用来解决同样问题的软件包上。有没有人遇到这个或知道一个解决方案?我无法找到有关此错误的大量信息。

0 个答案:

没有答案