Error: Element type is invalid: expected a string (for built-in components) or a class/function❗️

2024. 6. 26. 18:16·Error
반응형

❗️Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

오류발생원인

  • components 의 이름과 코드 경로가 잘못됬을경우 발생
  • export default 작성하지 않을때도 발생

본인은 뒤에 export default 작성하지 않아서 오류가 발생

실수코드 예시

'use client';

import SideBar from '@/components/SideBar/SideBar';
import ThumbnailEditor from '@/components/ThumbnailEditor/ThumbnailEditor';
import styled from 'styled-components';

const Container = styled.div`
  display: flex;
  flex-direction: row;
`;

const thumbnailgenerator = () => {
  return (
    <Container>
      <ThumbnailEditor />
      <SideBar />
    </Container>
  );
};

 

위에 코드에 마지막에 export default thumbnailgenerator 를 작성하지 않아 오류가 발생했다.

반응형

'Error' 카테고리의 다른 글

[React-Native CLI] react-native-vector-icons 설치에러 해결 과정  (0) 2025.01.13
[ React-Native CLI ] 설치후 Build 안되는 에러해결 방법  (0) 2024.12.25
[ React-Native CLI ] 개발 오류 ❗️Execution failed for task ':react-native-safe-area-context:compileDebugKotlin'.  (2) 2024.12.25
Next.js 에❗️TypeError: Cannot read properties of undefined (reading 'prototype')  (1) 2024.05.13
❗️Parsing error : Cannot find module 'next/babel’ 오류 해결  (3) 2024.05.08
'Error' 카테고리의 다른 글
  • [ React-Native CLI ] 설치후 Build 안되는 에러해결 방법
  • [ React-Native CLI ] 개발 오류 ❗️Execution failed for task ':react-native-safe-area-context:compileDebugKotlin'.
  • Next.js 에❗️TypeError: Cannot read properties of undefined (reading 'prototype')
  • ❗️Parsing error : Cannot find module 'next/babel’ 오류 해결
WHITE_FROST
WHITE_FROST
개발공부리뷰블로그
    반응형
  • WHITE_FROST
    하얀하얀IT
    WHITE_FROST
  • 전체
    오늘
    어제
    • 분류 전체보기 (119)
      • Stack (43)
        • Next.js (7)
        • React (12)
        • React-Native (15)
        • TypeScript (0)
        • Python (2)
        • JavaScript (2)
        • Android (1)
        • DB (2)
        • JAVA (1)
      • Obsidian (1)
      • AI (3)
      • AI Tools (0)
      • Tools (0)
      • Mac (0)
      • Error (7)
      • 알고리즘 정리 (6)
      • 알고리즘 문제풀이 (46)
      • 공부일상 (4)
      • 개발 도구 & 라이브러리 (0)
      • 정보처리기사 (0)
      • 기타 (6)
      • Tip (2)
  • 블로그 메뉴

    • 홈
    • 태그
    • 미디어로그
    • 위치로그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    ios
    react
    react-native
    SWEA
    d1
    코테준비
    백준
    알고리즘
    React Hooks
    오블완
    mongodb cloud
    코딩테스트
    java
    Next.js
    티스토리챌린지
    코테
    boj
    react-native-maps
    리액트네이티브
    reactnative
    React-Native cli
    Python
    javascript
    ReactHook
    프로그래머스
    error
    mongoDB Atlas
    Expo
    hooks
    D2
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.5
WHITE_FROST
Error: Element type is invalid: expected a string (for built-in components) or a class/function❗️
상단으로

티스토리툴바