Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] Back_ES6 import 형식으로 디렉토리를 불러올 때 발생하는 오류 #43

Open
SsankQ opened this issue Mar 2, 2022 · 0 comments

Comments

@SsankQ
Copy link
Collaborator

SsankQ commented Mar 2, 2022

해결된 에러라면 라벨에 'Complete' 를 달아주세요.
미해결된 에러라면 라벨을 'In progress' 로 변경해주세요.

어떤 에러인가요?

  • CommonJS 형식이 아닌 ES6 import 형식으로 Directory를 불러올 때 정상적으로 불러오지 못하며 에러가 발생

에러 메시지

Directory import '폴더 경로' is not supported resolving ES modules imported from '폴더 경로'
Did you mean to import '상세 파일 경로'?

에러 핸들링 방법

  • 디렉토리를 지정해주면 import Error가 발생하므로 상세 파일까지 직접 지정했더니 해결되었다
  • 위 방법 말고도 CommonJS 형태로 변경하여 require를 통해 불러오는 것으로도 해결할 수 있었다

에러 핸들링을 위해 참고한 레퍼런스 링크

sveltejs/kit#612
stack over flow

@SsankQ SsankQ added this to the Error Handling milestone Mar 2, 2022
@SsankQ SsankQ self-assigned this Mar 2, 2022
@SsankQ SsankQ added the Error label Mar 2, 2022
@SsankQ SsankQ changed the title [Error] ES6 import 형식으로 디렉토리를 불러올 때 발생하는 오류 [Error] Back_ES6 import 형식으로 디렉토리를 불러올 때 발생하는 오류 Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant