我正在尝试在React chrome扩展模块中使用axios,但我遇到了这个问题。
Uncaught(in promise)错误:错误:适配器'http'在构建中不可用
// background.ts
import axios from "axios"
...
axios.get<SerInyResponse>("https://realtor.p.rapidapi.com/locations/v2/auto-complete")
.then(response => {
this.Storage.setLocalStorage(response.data).then( (re) => {
resolve(response.data.Listeners)
})
})
.catch( err => {
reject(new Error(err))
})
谁能帮帮我?
2条答案
按热度按时间csbfibhn1#
使用Fetch写入
const res = await fetch(url, { method: "GET", credentials: "include", headers: { Cookie: token }, });
6mw9ycah2#
service worker只支持fetch