inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

따라하며 배우는 리액트 A-Z[19버전 반영]

getStaticProps를 이용한 포스트 리스트 나열

Module not found: Error: Can't resolve 'fs'

609

주 다슬
0

Module not found: Error: Can't resolve 'fs'

에러가 납니다.

webpack에 따라 fs가 지원이 안된다는 내용을 보았는데 어떻게 해야할까요?

그리고 저희가 수업중에 webpack을 따로 install하거나 구성한적이 있나요?

 

그리고 export const getStaticeProps 부분 에서

아래와 같은 오류가 나는데 형식이 맞지 않는다고 합니다. 무슨 이유 때문일까요?

'() => Promise<{ porps: { allPostData: { date: string; title: string; id: string; }[]; }; }>' 형식은 'GetStaticProps<{ [key: string]: any; }, ParsedUrlQuery, PreviewData>' 형식에 할당할 수 없습니다.

'Promise<{ porps: { allPostData: { date: string; title: string; id: string; }[]; }; }>' 형식은 'GetStaticPropsResult<{ [key: string]: any; }> | Promise<GetStaticPropsResult<{ [key: string]: any; }>>' 형식에 할당할 수 없습니다.

'Promise<{ porps: { allPostData: { date: string; title: string; id: string; }[]; }; }>' 형식은 'Promise<GetStaticPropsResult<{ [key: string]: any; }>>' 형식에 할당할 수 없습니다.

'{ porps: { allPostData: { date: string; title: string; id: string; }[] ㅇ

답변 0