프론트엔드 도커파일 실행 중 오류
1088
작성한 질문수 53
15.97 src/components/header/Header.tsx(1,8): error TS6133: 'React' is declared but
its value is never read.
15.97 src/components/header/Header.tsx(6,19): error TS6133: 'setIsLogin' is declare
d but its value is never read.
15.98 src/components/header/Header.tsx(9,9): error TS6133: 'border' is declared but
its value is never read.
15.99 src/components/htmlEditor/HtmlEditor.tsx(1,8): error TS6133: 'React' is decla
red but its value is never read.
15.99 src/components/htmlEditor/HtmlEditor.tsx(2,20): error TS7016: Could not find
a declaration file for module '@toast-ui/editor'. '/app/node_modules/@toast-ui/edit
or/dist/esm/index.js' implicitly has an 'any' type.
15.99 There are types at '/app/node_modules/@toast-ui/editor/types/index.d.ts', b
ut this result could not be resolved when respecting package.json "exports". The '@
toast-ui/editor' library may need to update its package.json or typings.
15.99 src/main.tsx(1,1): error TS6133: 'React' is declared but its value is never r
ead.
15.99 src/pages/myPage/MyPost.tsx(1,1): error TS6133: 'React' is declared but its v
alue is never read.
15.99 src/pages/post/ReadPage.tsx(1,8): error TS6133: 'React' is declared but its v
alue is never read.
15.99 src/pages/post/ReadPage.tsx(4,1): error TS6133: 'search' is declared but its
value is never read.
15.99 src/pages/post/ReadPage.tsx(8,19): error TS6133: 'setIsLogin' is declared but
its value is never read.
------
failed to solve: process "/bin/sh -c npm run build" did not complete successfully:
exit code: 2
이런 오류는 어떡하나요?
답변 1
0
안녕하세요, 인프런 AI 인턴입니다. jacomyou님, TypeScript에서 발생한 오류는 불필요한 변수나 import된 모듈이 코드 내에서 사용되지 않아 나타나는 경우가 대부분입니다.
첫 번째로, React나 setIsLogin, border 처럼 선언되었지만 사용되지 않는 변수들은 해당 파일에서 사용하지 않는 경우이니 코드 상에서 제거하시거나 주석 처리하여 오류를 해결할 수 있습니다.
두 번째로, '@toast-ui/editor' 모듈과 관련된 오류는 @toast-ui/editor 라이브러리의 타입 선언 파일을 찾지 못해서 발생하는 문제입니다. 이 경우는 해당 라이브러리의 타입 선언 파일이 존재하는지 확인하고, tsconfig.json에 "typeRoots" 또는 "paths"를 적절히 설정하여 해결할 수 있습니다.
또한, 패키지 관리자의 패키지 설치 문제로 인한 것일 수도 있으니 node_modules 폴더와 package-lock.json 또는 yarn.lock 파일을 삭제한 다음, npm install 또는 yarn install을 재실행해보는 것도 좋은 방법입니다.
마지막으로 failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 2 오류는 위에 나열된 오류들로 인해 빌드 프로세스가 실패하여 나타난 것입니다. 따라서 위에서 언급한 오류들을 해결하면 빌드 프로세스도 정상적으로 완료될 가능성이 높습니다.
도움이 필요하다면 추가적인 정보가 담긴 Stack Overflow나 관련 커뮤니티에서 검색하거나, 더 자세한 안내를 원하신다면 관련 질문을 포럼이나 커뮤니티에 올려 도움을 받는 방법도 있습니다.
Docker Containers간 통신 할 때 나타나는 에러 강의 질문
0
80
1
WINDOW + Vite를 사용하여 소스 코드 변경이 반영되지 않는 현상
0
79
1
도커 컨테이너 끼리 SSL 통신 시 문제가 생깁니다..
0
216
1
도표 강의 자료 사용이 불가합니다. (권한 문제)
0
136
1
Docker compose 관련 공유
0
142
1
트레비스가 유료화가 되어 테스트가 어려워 챕터8에서 고민중입니다.
0
79
1
강사님 혹시 vscode 어떤 테마 쓰시나요..?
0
285
1
The instance profile aws-elasticbeanstalk-ec2-role associated with the environment does not exist.
0
105
1
travis ci가 이제 유료화가 된 것 같습니다;;;
0
210
2
docker-compose up 에러 공유 드립니다
0
291
1
Elastic Beanstalk에서 도메인 클릭시 react 이미지가 안나오고 다른 화면이 나오는데
0
170
1
도커 빌드 시간이 너무 오래걸려요..
0
1062
2
docker-compose down 이후에도 containers에 redis가 남아 있는 이유
0
168
1
도커 볼륨이 작동이 안되는것 같아서 질문드립니다!
0
213
2
docker-compose 가 Docker Desktop 에서 빠진건가요? command not found 라고 뜨네요
0
279
1
Error response from daemon: The system cannot find the file specified.
0
220
1
draw.io 오류
0
650
1
Docker Volume 오류(reference, lowercase)
0
564
1
[섹션3 - 내가 만든 이미지 기억하기 쉬운 이름 주기] 네이밍/태그 에러
0
226
1
axios오류 문의드립니다!
0
334
1
node.js version
0
485
1
안녕하세요 마지막 강의 질문 있습니다.
0
435
1
Deploy를 계속 실패합니다.
3
1383
4
TravisCI에서 계속 에러가 납니다....
0
358
1





