• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

Attempted import error: 'Icon' is not exported from 'antd'. 에러가 뜹니다.

21.04.24 23:31 작성 조회수 690

0

Failed to compile.

[1] ./src/components/views/Footer/Footer.js

[1] Attempted import error: 'Icon' is not exported from 'antd'.

npm run dev 입력한 뒤 페이지 열리면서 이런 에러가 뜹니다

대처 해본 것은

1. npm install를 root디렉토리랑 clinet 디렉토리 들어가서 해주었고

2. npm install antd도 해보았습니다.

답변 2

·

답변을 작성해보세요.

0

Haneul Lee님의 프로필

Haneul Lee

2021.04.28

저도 같은 문제가 있었습니다! 이 글 보고 해결했는데, 정확히는 
import {Form, Input, Button, ... } from 'antd'와 같이 여러개를 한번에 import 해 주는 문장에서 Icon만 따로 
import Icon from '@antd-design/icons'로 빼 주시고,
나머지는 그대로 npm install antd --save-dev 해 주시면  잘 실행이 되네요!

0

권혁진님의 프로필

권혁진

질문자

2021.04.24

해결 했습니다.

기존에

import Icon from 'antd'로 되있던것 컴포넌트에 있는 것 전부 아래걸로 교체하시면 됩니다.

import Icon from '@ant-design/icons';
그리고 터미널에 입력:
npm install @ant-design/icons --save-dev