작성
·
1.6K
·
수정됨
0
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
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
./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
npm i antd4로 설치를 하였습니다 같은상황이 발생하였습니다.
-강의 내용에서는
(1) import 'antd/dist/antd.css' 설명하셧는데욥
블로그로 보면
(2)import {Menu, Input} from 'antd';
으로 됫어요
지금 (2)으로수정할까요?
무슨 말씀이신지 이해가 안 되네요. Menu랑 Input을 뜬금없이 왜 넣나요?
https://github.com/ZeroCho/react-nodebird/blob/master/ch2/front/pages/_app.js
제 코드는 여기에 있습니다. 남의 블로그는 제 강좌랑 버전이 다를 수도 있습니다.