[에러 일지] [eslint] 'unable to resolve path to module' 에러

uxolrv·2022년 10월 31일
3
post-thumbnail

❗️ 문제 1 : [eslint] 'unable to resolve path to module' 에러

Editor.js

import { CKEditor } from '@ckeditor/ckeditor5-react';
import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

Error !
unable to resolve path to module '@ckeditor/ckeditor5-react'
unable to resolve path to module '@ckeditor/ckeditor5-build-classic'

모듈의 경로를 못찾는 에러가 발생하였다.




✨ 해결

.eslintrc.json

    "settings": {
      // import/resolver` 는 `eslint-plugin-import` 의 경로 설정 옵션
        "import/resolver": {
          "node": {
            "paths": ["src"]
          }
        }
      }

import를 상대 경로(ex. ./someting/someting)가 아닌 절대 경로로 행하고 있어, 경로를 인식하지 못한 것으로 보인다.

node에서 사용되는 절대 경로를 src로 설정해주어 해결하였다!










참고
https://baeharam.netlify.app/posts/lint/Lint-ESLint-+-Prettier-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0

profile
안녕하세연🙋 프론트엔드 개발자입니다

0개의 댓글

관련 채용 정보