从Vue 2升级至Vue 3后,应用在Firefox中无法正常运行
Vue中Axios请求始终返回Promise错误
- 发起Axios请求时控制台出现错误
- 存在对应错误日志
Vue实例可正常创建,但调用Axios请求获取数据时始终返回Promise错误。
相关代码如下:
fetchReports(body) { const inst = axios.create(); store.state.currentListing = 'RecentReportListing'; this.interceptRequest(inst, "setMyReportsInProgressStatus"); this.interceptResponse(inst, "setMyReportsCompleteStatus"); return inst .post(this.baseUrl() + "getReports", body, { headers: getAppConfig().headers }) .then(response => { return response.data; }) .catch(error => { this.logHttpException(this.url, "getReports", error); }); },
已尝试的排查步骤:
- 移除废弃的babel/polyfill库,改用core-js和runtime,问题仍未解决
- 相同代码在Chrome和Edge浏览器中可正常运行
内容的提问来源于stack exchange,提问作者RESHAM SRIVASTAVA
相关产品推荐
相关产品推荐

