타입스크립트 작동 안됨
안녕하세요! 강의 잘 듣고 있습니다.
10-TS 기초 강의를 듣고 TS 설치를 완료했는데, 저는 componemt의 타입을 지정하라는 등의 오류가 실행되지 않습니다. 콘솔 창에서는 별다른 에러 없이 잘 설치되었는데도요.
yarn dev를 막 끝내고 _app.js를 tsx로 변경하니
터미널 콘솔에는 이렇게 뜹니다.
PS C:\Users\Yun\Desktop\frontEnd\class> yarn dev
yarn run v1.22.21
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
We detected TypeScript in your project and created a tsconfig.json file for you.
event - compiled client and server successfully in 4.7s (388 modules)
wait - compiling...
event - compiled client and server successfully in 321 ms (388 modules)
wait - compiling...
error - ./pages/_app.tsx
Error: error: Unexpected token ,. Expected yield, an identifier, [ or {
|
3 | export default function App({ Component : , pageProps }) {
| ^
Caused by:
0: failed to process js file
1: Syntax Error
wait - compiling...
event - compiled client and server successfully in 5.7s (388 modules)
wait - compiling...
error - ./pages/_app.tsx
Error: error: Expected ',', got '}'
|
3 | export default function App({ Component}, pageProps }) {
| ^
뭐가 문제일까요?
답변 1
0
안녕하세요! 여정님!
문법상 에러가 있는 것으로 보이네요!
에러 메시지를 확인해 보니, ' , ' 부분에서 문제가 있다고 하네요!
App({ Component }, { pageProps }) => App({ Component, pageProps }) 로 변경 되어야 할 것 같아요!
또한, 현재 과정에서는 pageProps는 필요하지 않으므로 App({ Component }) 로 수정하시는 것도 괜찮습니다!^^(해당 내용은 배포단계에서 배워요!)
fetchBoardsOfMine, fetchBoardsCountOfMine 에러 문의드립니다
0
36
1
댓글 기능 구현 중 질문드립니다.
0
66
1
쿠폰코드 발급
0
133
2
example 서버 플레이그라운드, API 접속 모두 안됩니다.
0
86
2
문의드립니다!! ㅠㅠ
0
101
2
graphql 백엔드 서버가 포폴용 빼곤 접속이 안됩니다.
0
76
2
_app.js 작성 이후로 에러가 발생하네요
0
93
2
학습자료
0
70
2
학습자료가 안열립니다.
0
49
2
플레이 그라운드 퀴즈 문제 질문이 있습니다.
0
60
0
기존강의 구매자, 업데이트 끝인가요?
0
109
3
업데이트 버전 수강
0
88
2
완벽한 프론트엔드
0
136
2
나만의 쇼핑몰 샘플 페이지 접속 확인부탁드립니다.
0
83
1
graphql 접속이 안됩니다.
0
100
2
const, let 사용 질문 드립니다.
0
70
2
싸이월드 만들기 1탄 피드백 부탁드립니다.
0
122
2
회원가입 과제 피드백 부탁드립니다.
0
80
2
styled.span / styled.input "CSS 자동완성"
0
47
1
쿠폰 발급 관련
0
166
2
서버 502 error
0
247
2
쿠폰 다시 부탁드려도 될가여?
0
140
2
a태그 패딩했을때 왜 크기가 줄어들지 않고 늘어나나요
0
184
2
2분 44초 질문
0
131
3





