인프런 커뮤니티 질문&답변

rud1505님의 프로필 이미지

작성한 질문수

Vue.js 완벽 가이드 - 실습과 리팩토링으로 배우는 실전 개념

에러 도와주세요...

해결된 질문

22.02.17 19:28 작성

·

402

1

 created() {
    const user = this.$route.params.id;

    // this.$store.dispatch("FETCH_USERS", user);
    axios()
      .get(`https://api.hnpwa.com/v0/user/${user}.json`)
      .then((e) => {
        this.dodo = e.data;
      })
      .catch((e) => {
        console.log(e);
      });
},
뭐가 잘못된건지 모르겟습니다.. 아래는 에러코드에요.
 
Axios.js?0a06:40 Uncaught (in promise) Error: Provided config url is not valid at Axios.request (Axios.js?0a06:40:1) at wrap (bind.js?1d2b:9:1) at Proxy.created (UserView.vue?32f5:18:1) at callWithErrorHandling (runtime-core.esm-bundler.js?5c40:155:1) at callWithAsyncErrorHandling (runtime-core.esm-bundler.js?5c40:164:1) at callHook (runtime-core.esm-bundler.js?5c40:2965:1) at applyOptions (runtime-core.esm-bundler.js?5c40:2867:1) at finishComponentSetup (runtime-core.esm-bundler.js?5c40:7159:1) at setupStatefulComponent (runtime-core.esm-bundler.js?5c40:7071:1) at setupComponent (runtime-core.esm-bundler.js?5c40:7001:1)
 
 
 
 
 
 

답변 1

0

장기효(캡틴판교)님의 프로필 이미지

2022. 02. 17. 19:29

axios().get()이 아니라 axios.get() 으로 하셔야 해요 :)

rud1505님의 프로필 이미지
rud1505
질문자

2022. 02. 17. 19:30

앜ㅋㅋ 감사합니다...

rud1505님의 프로필 이미지

작성한 질문수

질문하기