강의

멘토링

커뮤니티

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

박균재님의 프로필 이미지
박균재

작성한 질문수

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

async & await 예제 소개

"error: Unexpected console statement (no-console) at ..." 에러 관련 질문입니다.

해결된 질문

작성

·

496

2

안녕하세요!

async-await 강의 및 실습을 위해 제가 아래와 같이 신규 프로젝트를 생성 했습니다.

PS C:\Dev_Env\workspace\vue-advanced\cd async-await

PS C:\Dev_Env\workspace\vue-advanced\ async-await >npm install

PS C:\Dev_Env\workspace\vue-advanced\ async-await >npm install -g @vue/cli

PS C:\Dev_Env\workspace\vue-advanced\ async-await >npm install --save axios

PS C:\Dev_Env\workspace\vue-advanced\async-await> npm run serve

참고로 Vue 버젼은 아래와 같습니다.

PS C:\Dev_Env\workspace\vue-advanced\async-await> vue -V

@vue/cli 4.0.5

질문 : 실습을 위해 app.vue의 console.log를 수정 했더니 아래와 같이 에러가 나옵니다.

98% after emitting CopyPlugin

 ERROR  Failed to compile with 1 errors                                  11:15:58 AM

 error  in ./src/App.vue

Module Error (from ./node_modules/eslint-loader/index.js):

error: Unexpected console statement (no-console) at src\App.vue:20:27:

  18 |     loginUser() {

  19 |       axios.get('https://jsonplaceholder.typicode.com/users/1')

> 20 |         .then(response => console.log('tt', response))

     |                           ^

  21 |         .catch(error => console.log(error));

  22 |     },

  23 |   },

추가로 package,json의 내용중 no-console의 옵션울 off로 수정하면 된다는 내용이 있어 추가 했는데 결과는 동일합니다.

물로 추가후 vue run serve를 리부팅했습니다.

        "rules": {},
        "parserOptions": {
            "no-console""off",
            "parser""babel-eslint"
       }

답변 1

0

안녕하세요 pgyunjae님, 해당 오류 관련해서는 아래 링크에 제가 답변 달아놓은 것 보시면 좋을 것 같습니다 :)

https://www.inflearn.com/questions/15993

박균재님의 프로필 이미지
박균재

작성한 질문수

질문하기