web-report-sdk icon indicating copy to clipboard operation
web-report-sdk copied to clipboard

fetch请求方式报错

Open chenchenyuyu opened this issue 6 years ago • 1 comments

Uncaught (in promise) TypeError: Failed to execute 'json' on 'Response': body stream is locked

chenchenyuyu avatar May 07 '19 09:05 chenchenyuyu

我也碰到这个问题了, fetch的res只能调用一次text或者json之类的方法, sdk这里调了一次res.text(), res.body就被lock了。。。 希望作者能解决一下 return _fetch.apply(this, arguments) .then((res) => { if (result.type === 'report-data') return; getFetchTime('success') try { const url = res.url ? res.url.split('?')[0] : ''; res.text().then(data => { if (conf.ajaxMsg[url]) conf.ajaxMsg[url]['decodedBodySize'] = data.length; }) } catch (e) { } return res })

kissshot avatar Jul 17 '19 08:07 kissshot