inflearn logo
강의

Course

Instructor

[Code Camp] A highly concentrated front-end course created at Bootcamp

Server Error Error: The default export is not a React Component in page: "/02-02-counter-state"

Resolved

1349

wasabi9812

22 asked

0

 강의 들을때마다 점점 지치네요.. 맥 윈도우 다쓰는데 매번 오류나고 뭐가문제인지 모르겠네요 공부를 하려고 해도 의욕이 떨어져요

 

Server Error

Error: The default export is not a React Component in page: "/02-02-counter-state"

This error happened while generating the page. Any console logs will be displayed in the terminal window.

Call Stack

Object.renderToHTML

file:///Users/jinho/Desktop/codecamp-frontend-jinho/class/node_modules/next/dist/server/render.js (234:19)

doRender

file:///Users/jinho/Desktop/codecamp-frontend-jinho/class/node_modules/next/dist/server/next-server.js (1392:57)

<unknown>

file:///Users/jinho/Desktop/codecamp-frontend-jinho/class/node_modules/next/dist/server/next-server.js (1487:34)

<unknown>

file:///Users/jinho/Desktop/codecamp-frontend-jinho/class/node_modules/next/dist/server/response-cache.js (63:42)

ResponseCache.get

file:///Users/jinho/Desktop/codecamp-frontend-jinho/class/node_modules/next/dist/server/response-cache.js (80:11)

DevServer.renderToResponseWithComponents

file:///Users/jinho/Desktop/codecamp-frontend-jinho/class/node_modules/next/dist/server/next-server.js (1423:53)

DevServer.renderToResponse

file:///Users/jinho/Desktop/codecamp-frontend-jinho/class/node_modules/next/dist/server/next-server.js (1559:39)

process.processTicksAndRejections

node:internal/process/task_queues (95:5)

async DevServer.pipe

file:///Users/jinho/Desktop/codecamp-frontend-jinho/class/node_modules/next/dist/server/next-server.js (1111:25)

async Object.fn

file:///Users/jinho/Desktop/codecamp-frontend-jinho/class/node_modules/next/dist/server/next-server.js (912:21)

node.js react seo graphql next.js nodejs Next.js

Answer 1

0

wasabi9812

해결한게 export default function Counterstatepage(){} 여기에서 count 스펠링이 틀렸는데

함수선언을 할때 무조건 폴더명이랑 일치해야하나요?

-부분은 제외하고 page는 추가하고

0

jaake975425

안녕하세요 진호님!

해당 에러는 컴포넌트를 export 할 때 default로 내보내지 않았을 때 발생하는 오류 입니다.
컴포넌트를 그냥 export 만해서 내보내진 않았는지 확인해보시고, 다시 답글 주세요!

그리고 컴포넌트 네임이 반드시 폴더명과 일치해야하는 것은 아닙니다!

- 에러 핸들링 팁 : [ Error: ---에러 메세지--- ] 를 복사해 구글링을 하시면 에러핸들링이 가능함과 동시에 실력도 향상됩니다!

감사합니다.😁

0

wasabi9812

제가 구글에 검색엄청 많이해요 항상 문제있을때마다 하는데도 잘안나오는경우가 많네요 영어를 못하는것도 아니라 stack overflow에서 있는것도 읽어봐도 default빼먹엇냐 하는데 전혀안빼먹고 폴더명하고 컴포넌트이름하고 같게하니까 바로되더라고요 이상하네요

fetchBoardsOfMine, fetchBoardsCountOfMine 에러 문의드립니다

0

32

1

댓글 기능 구현 중 질문드립니다.

0

64

1

쿠폰코드 발급

0

127

2

example 서버 플레이그라운드, API 접속 모두 안됩니다.

0

85

2

문의드립니다!! ㅠㅠ

0

101

2

graphql 백엔드 서버가 포폴용 빼곤 접속이 안됩니다.

0

75

2

_app.js 작성 이후로 에러가 발생하네요

0

93

2

학습자료

0

68

2

학습자료가 안열립니다.

0

47

2

플레이 그라운드 퀴즈 문제 질문이 있습니다.

0

58

0

기존강의 구매자, 업데이트 끝인가요?

0

107

3

업데이트 버전 수강

0

87

2

완벽한 프론트엔드

0

135

2

나만의 쇼핑몰 샘플 페이지 접속 확인부탁드립니다.

0

80

1

graphql 접속이 안됩니다.

0

99

2

const, let 사용 질문 드립니다.

0

69

2

싸이월드 만들기 1탄 피드백 부탁드립니다.

0

121

2

회원가입 과제 피드백 부탁드립니다.

0

78

2

styled.span / styled.input "CSS 자동완성"

0

46

1

쿠폰 발급 관련

0

165

2

서버 502 error

0

246

2

쿠폰 다시 부탁드려도 될가여?

0

139

2

a태그 패딩했을때 왜 크기가 줄어들지 않고 늘어나나요

0

181

2

2분 44초 질문

0

127

3