codestates / codestates/conimals
[정새얀] 220705 Re-Error Handling
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
> 해결된 에러라면 라벨에 'Complete' 를 달아주세요.
> 미해결된 에러라면 라벨을 'In progress' 로 변경해주세요.
### 어떤 에러인가요?
- typescript 적용 중 나오는 에러.
서버 실행 시 config를 require해오지 못함.
### 에러 메시지
```bash
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
src/models/index.ts:2:20 - error TS2307: Cannot find module '../config/config' or its corresponding type declarations.
2 import config from '../config/config';
```
### 에러 핸들링 방법
- 정확한 경로를 써주어도 타입스크립트에서 제대로 된 경로인지 알 수 없는 에러 메시지로 받아들였다.
그래서 vs code에서 import 경로에 별칭을 사용할 수 있는 방법을 찾아내어 tsconfig.json에 옵션을 적용시켜주었다.
### 에러 핸들링을 위해 참고한 레퍼런스 링크
[vs code에서 import 경로에 별칭 붙여주기](https://seungtaek-overflow.tistory.com/17)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.