VueBUG——Uncaught Error: Provided config url is not valid

x33g5p2x  于2022-02-12 转载在 Vue.js  
字(0.6k)|赞(0)|评价(0)|浏览(371)

Uncaught Error: Provided config url is not valid

记录一个BUG,因为之前vue项目中在main.js使用了Vue.use(axios)而出现的

错误详情

Uncaught Error: Provided config url is not valid
    at Axios.request (Axios.js?0a06:40:1)
    at wrap (bind.js?1d2b:9:1)
    at Function.Vue.use (vue.runtime.esm.js?2b0e:5123:1)
    at eval (main.js?56d7:11:1)
    at Module../src/main.js (app.js:1088:1)
    at __webpack_require__ (app.js:854:30)
    at fn (app.js:151:20)
    at Object.1 (app.js:1113:18)
    at __webpack_require__ (app.js:854:30)
    at checkDeferredModules (app.js:46:23)

解决方法:axios不需要install,所以Vue.use(axios)是非法的。

还有一种方式是

import axios from 'axios'
import VueAxios from 'vue-axios'

Vue.use(VueAxios,axios);

相关文章

微信公众号

最新文章

更多