Projects/Next.js board-project

Projects/Next.js board-project

[Next.js] 배포 에러 고치기

에러 문구 error ESLint: Failed to load config "next/core-web-vitals" to extend from. Referenced from: /vercel/path0/.eslintrc 원인 어쩐지 에러가 안잡히는 부분이 있더라더니 next.js에서의 ESLint 설정을 제공하는 패키지를 설치 하지 않았었다. 아래 명령어로 패키지를 설치하고 해결! 해결 npm i --save-dev eslint-config-next eslint-config-prettier eslint-plugin-prettier https://stackoverflow.com/questions/69480558/error-failed-to-load-config-next-to-extend-from Error:..

Projects/Next.js board-project

[Next.js] 묵혀둔 프로젝트 고치기 - 좋아요 기능

주절주절 분명 예전에는 하트를 누르면 늦게나마 빨간 하트가 되었는데 요청은 정상적으로 되나 빨간 하트로 변하지 않았다. const session: UserInfo | null = await getServerSession(authOptions); const db = (await connectDB).db('forum'); let result = await db.collection('post').findOne({ _id: new ObjectId(props.params.id) }); if (result) { result._id = result._id.toString() as unknown as ObjectId; } let foundOne; if (session) { foundOne = await db.colle..

Projects/Next.js board-project

[Next.js] cannot be used as a jsx component.

문제 오랜만에 뜯어본 Next.js의 게시판 프로젝트에 다음과 같은 에러가 발생했습니다. 비동기 함수인 컴포넌트는 프로미스 객체를 리턴합니다. 하지만 이게 왜... 문제죠? 멋진 icyJoseph의 의견에 따르면 typescript가 async 컴포넌트를 이해 하지 못한다고 합니다. 따라서 해당 주석을 달아 임시방편으로 오류를 해결할 수 있다고 합니다. 해결방안 1. 주석달기 export default async function Home() { return ( {/* @ts-expect-error Server Component */} 뭔가 멋진 메인 사진을 걸고 싶어요 캐러셀같은거 넣으면 좋겠다 ); } 아무래도 주석이 있는 것은 영 찜찜합니다. 해결방안 2. 업데이트하기 역시 정답은 공식문서에 있었습니..

Summer.dev
'Projects/Next.js board-project' 카테고리의 글 목록