inflearn logo
강의

Course

Instructor

Developing a Tech Blog with React-Based Gatsby

Learn GraphQL Queries

createfiberfromtypeandprops 에러

Resolved

563

inust33

16 asked

1

다음과 같은 에러가 납니다

 

```

Error in function createFiberFromTypeAndProps in ./node_modules/react-dom/cjs/react-dom.development.js:25058

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you m₩

ight have mixed up default and named imports. Check the render method of `IndexPage`.

```

index page 파일은 다음과 같습니다.

import React, { FunctionComponent } from 'react'

import Text from 'components/Text'

const IndexPage: FunctionComponent = function () {
return (
<div>
<Text text="Home" />
</div>
)
}
export default IndexPage

 

별다른 에러는 없어 보이는데 왜일까요?

develop 명령어 실행시에 이런 콘솔창에 에러는 아니지만 이런 경고가 뜹니다.

```

warn ./src/pages/info.tsx

Attempted import error: 'components/Text' does not contain a default export (imported as 'Text').

```

gatsby-config.js와

gatsby-node.js는 모두 강의에 나온 그대로 설정하였습니다.

 

blog Gatsby

Answer 1

0

ji5485

안녕하세요, inust33님!

Text 컴포넌트에 아래와 같은 코드가 있는지 확인 부탁드려요!

export default Text

만약 해당 코드가 있음에도 오류가 발생한다면 댓글로 깃허브 레포지토리 링크 남겨주시면 확인 후 답변 남겨드리겠습니다!

쿼리오류 Field "thumbnail" must not have a selection...

1

887

1

타입스크립트를 설정할 때 jsxPragma 옵션을 뺀 이유는 무엇인가요?

1

621

1

마지막 배포 부분 질문드립니다!

1

642

1

'[username]/[username].github.io' -> 'username/reponame'

0

356

0

IntersectionObserver deploy( gatsby build) 시 오류(자답)

1

415

1

PostHead.tsx BackgroundImage 동작오류(자답)

1

309

0

19강 인피니티 스크롤 IntersectionObserver 코드 위치 수정이 필요합니다.

1

422

1

썸네일 이미지 제작 및 학습 방법 관련 문의

1

463

1

배포 후 포스트 업로드 방법

1

404

1

배포 질문이요!

1

545

1

gatsby develop 오류

1

957

1

깃허브 레퍼지토리 질문드려요

1

358

1

특정 게시글을 클릭하여 상세 페이지로 넘어가는 과정과 SPA에 관한 질문

1

294

1

Unhandled Runtime Error 가 뜹니다

0

523

2

sign in with GitHub 클릭 시

1

424

3

동작 반복 시 오류

1

369

2

const BackgroundImage 질문

1

226

1

오타 문의

1

323

2

Props로 받아 포스트 데이터 출력하기가 안됩니다.

1

216

1

index.tsx allMarkdownRemark 에러..

0

616

2

스네이크 케이스로 변수명을 짓는 이유

1

264

1

'Tagged Template Literal 방식을 통해 정의한 CSS 적용 방법'에서 발생하는 문제

3

367

2

상단 이미지를 썸네일 사용하지않고 다른 이미지를 쓰고싶습니다

1

289

1

여기까지 했는데 runtime 에러가 발생합니다

2

303

1