티스토리 뷰

반응형

1. 현상

: yarn serve 실행 시 Failed to compile with 3 errors가 발생하면서 다음과 같은 에러문이 나타났다.

 

These dependencies were not found:

 

* core-js/modules/es.function.name in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-l!./node_modules/vue-loader/lib??vue-loader-options!./src/components/ContactForm.vue?vue&type=script&lang=js&   
* core-js/modules/es.regexp.exec in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&
* core-js/modules/es.string.replace in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=js&

 

 

2. 원인

: (참고사이트) https://github.com/vuejs/vue-cli/issues/3678

  여러 개의 사이트에 나온 내용을 참고해서 다 실행해 봤는데 효과가 있었던 것은 이 사이트의 내용이었다. 

  바벨과 code-js 버전 사이에 서로 맞지 않는 부분이 있기 때문이라고 한다. 

  code-js 버전 2를 사용해야 하는데 바벨을 설치하면 code-js 버전 3을 같이 써야 하여 이 때문에 에러가 발생한다는 내용으로 보인다.

 

 

3. 해결

: barbel.config.js 파일 내용을 아래 처럼 바꾼다.

 

[수정 전 코드]

module.exports = {

    presets: [

        '@vue/cli-plugin-babel/preset'

    ]

}

 

[수정 후 코드]

module.exports = {

    presets: [

        [ "@vue/app", { useBuiltIns: "entry" } ]

    ]

}

 

 

4. 좀 더 좋은 해결책을 찾으면 내용을 수정하겠다.

 

 

 

 

반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함