Compiled with problems:
×
ERROR in src/pages/CommonLoginPage/CommonLoginPage.tsx:2:18
TS2305: Module '"components/common"' has no exported member 'AuthNavButton'.
1 | import React, { useState } from 'react';
> 2 | import { Button, AuthNavButton } from 'components/common';
| ^^^^^^^^^^^^^
3 | import { AuthInputBox, AuthLogoBox, AuthErrorMsg } from 'components/common';
4 | import { CommonLayout } from 'components/layout';
5 | import { login } from 'api/loginApi';
ERROR in src/pages/LoginPage/LoginPage.tsx:5:18
TS2305: Module '"components/common"' has no exported member 'AuthNavButton'.
3 | import { loginKakao } from 'api/loginApi';
4 | import { CommonLayout } from 'components/layout';
> 5 | import { Button, AuthNavButton } from 'components/common';
| ^^^^^^^^^^^^^
6 | import {
7 | StLoginContainer,
8 | StLogoWrapper,
ERROR in src/pages/RegisterPage/RegisterPage.tsx:9:3
TS2305: Module '"components/common"' has no exported member 'AuthNavButton'.
7 | AuthInputBox,
8 | AuthErrorMsg,
> 9 | AuthNavButton,
| ^^^^^^^^^^^^^
10 | } from 'components/common';
11 | import { register, confirmId, confirmNickname } from 'api/loginApi';
12 | import { useMutation } from '@tanstack/react-query';
분명 파일에 이상이 없는데 발생하는 경로 오류. 위와 같이 딱 파일 1개만 인식을 못한다. VSCODE를 껐다켜도 변화가 없고, 서버를 껐다켜도 변화가 없다.
에디터상에서 cmd키를 누르고 경로나 파일명을 누르면 해당 파일로 잘 이동하는걸 보니, 에디터는 경로를 잘 인식하고 있고,
해당 에러메세지가 TS에서 나오는걸 보니, 타입스크립트를 처리하면서 오류가 발생하는듯 하다.
그래서 타입스크립트 캐시삭제를 찾아보니, 서버 재시작은 있는데,
캐시 삭제는 매우 까다로워 보였다. 시스템 파일을 건드는건 너무 꺼려져서,
좀 우회해서 해결해보기로 했다.
tsconfig는 아래와 같았는데
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"baseUrl": "./src",
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"types": ["kakao.maps.d.ts"]
},
"include": ["src"]
}
여기에다가
"paths": { "components/*": ["components/*"] }
이거 한줄만 types 바로 밑에 추가해주니 바로 인식이 된다.
이건 components/~로 시작하는건 components/~ 경로로 인식하라는, 아무 의미없는 말인데,
그래서 인식이 성공적으로 된 다음에 해당 줄을 지워서 원상복구를 시켜놓으니
또 정상 작동이 된다.
아마 새로운 경로로 인식이 되면서, 캐시가 초기화된것으로 추측된다.
결과적으로 아무 파일도 변경시키지 않고 초기화!