import antd => import 방식이 달라진것같습니다 =>Module not found: Can't resolve 'antd/dist/antd.css'
1703
작성한 질문수 29
import React from 'react';
import PropTypes from 'prop-types';
import '~antd/dist/antd.css';
const App = ({ Component}) => {
return(
<Component/>
)
};
App.proptypes = {
Component: PropTypes.elementType.isRequired,
}
export default App;
----------------------------------------------
wait - compiling /_error (client and server)...
error - ./pages/_app.js:3:0
Module not found: Can't resolve '~antd/dist/antd.css'
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
> 3 | import '~antd/dist/antd.css';
4 |
5 | const App = ({ Component}) => {
6 | return(
https://nextjs.org/docs/messages/module-not-found
----------------------------------------------
import antd =>
import 방식이 달라진것같습니다 =>
Module not found: Can't resolve 'antd/dist/antd.css'
모듈을 찾을수없다고 나오네요 몰까욤
이런상황이네요 antd 버전이 다른것인가요
어떻게해결하죱? 흠?
------- ------- ------- -------
(현상황 스스로 해결한부분)
지금 > 3 | import '~antd/dist/antd.css'; 이부분
지우고 해도 css 적용이 자동으로 되서
그냥 import import '~antd/dist/antd.css';지우고 게속 진행중인데요
------- ------- ------- ------- -------
import '~antd/dist/antd.css'; 현재 import부분으로 지금버전으로변경해서 써야될거같기도 하다는 추측을 해봅니다
전 잘모르겟어서
강사님의 생각의 답변을 듣고싶습니다
답변 3
0
답변을 듣고
npm i antd4로 설치를 하였습니다 같은상황이 발생하였습니다.
PS D:\react-zero\front> npm i antd4
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the
owdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version
of core-js.
added 49 packages, and audited 350 packages in 51s
76 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
PS D:\react-zero\front> npm run dev
> react-zero@1.0.0 dev
> next
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./pages/_app.js:3:0
Module not found: Can't resolve 'antd/dist/antd.css'
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
> 3 | import 'antd/dist/antd.css'
4 |
5 | const NodeBrid = ({ Component }) => {
6 | return(
https://nextjs.org/docs/messages/module-not-found
wait - compiling /_error (client and server)...
error - ./pages/_app.js:3:0
Module not found: Can't resolve 'antd/dist/antd.css'
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
> 3 | import 'antd/dist/antd.css'
4 |
5 | const NodeBrid = ({ Component }) => {
6 | return(
https://nextjs.org/docs/messages/module-not-found
Failed to compile
./pages/_app.js:3:0
Module not found: Can't resolve 'antd/dist/antd.css'
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
> 3 | import 'antd/dist/antd.css'
4 |
5 | const NodeBrid = ({ Component }) => {
6 | return(
https://nextjs.org/docs/messages/module-not-foundnpm i antd4로 설치를 하였습니다 같은상황이 발생하였습니다.
-강의 내용에서는
(1) import 'antd/dist/antd.css' 설명하셧는데욥
블로그로 보면
(2)import {Menu, Input} from 'antd';
으로 됫어요
지금 (2)으로수정할까요?
0
무슨 말씀이신지 이해가 안 되네요. Menu랑 Input을 뜬금없이 왜 넣나요?
https://github.com/ZeroCho/react-nodebird/blob/master/ch2/front/pages/_app.js
제 코드는 여기에 있습니다. 남의 블로그는 제 강좌랑 버전이 다를 수도 있습니다.
넥스트 버젼 질문
0
79
2
로그인시 401 Unauthorized 오류가 뜹니다
0
91
1
무한 스크롤 중 스크롤 튐 현상
0
177
1
특정 페이지 접근을 막고 싶을 때
0
105
2
createGlobalStyle의 위치와 영향범위
0
97
2
인라인 스타일 리렌더링 관련
0
93
2
vsc 에서 npm init 설치시 오류
0
149
2
nextjs 15버전 사용 가능할까요?
0
160
1
화면 새로고침 문의
0
123
1
RTK에서 draft, state 차이가 있나요?
0
156
2
Next 14 사용해도 될까요?
0
452
1
next, node 버전 / 폴더 구조 질문 드립니다.
0
350
1
url 오류 질문있습니다
0
211
1
ssh xxxxx로 우분투에 들어가려니까 port 22: Connection timed out
0
380
1
sudo certbot --nginx 에러
0
1282
2
Minified React error 콘솔에러 (hydrate)
0
471
1
카카오 공유했을 때 이전에 작성했던 글이 나오는 버그
0
249
1
프론트서버 배포 후 EADDRINUSE에러 발생
0
330
1
npm run build 에러
0
519
1
front 서버 npm run build 중에 발생한 에러들
0
383
1
서버 실행하고 브라우저로 들어갔을때 404에러
0
339
2
css 서버사이드 랜더링이 적용되지 않아서 문의 드립니다.
0
289
1
팔로워 3명씩 불러오고 데이터 합쳐주는걸로 바꾸고 서버요청을 무한으로하고있습니다.
0
242
2
해시태그 검색에서 throttle에 관해 질문있습니다.
0
202
1





