From ce0dada5619b5471daf0b780a03bbd8c5cb552c1 Mon Sep 17 00:00:00 2001 From: paulcjy Date: Sat, 9 Dec 2023 03:17:50 +0900 Subject: [PATCH] fix: Fix generateStacitParams in [board]/page.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 소괄호로 객체를 감싸는 것을 깜빡해서 에러가 발생 generateStaticParams가 제대로 된 배열을 반환하지 않으니 빌드 시 아래 에러 메시지가 뜸 Error: Page "/blog/[board]" is missing "generateStaticParams()" so it cannot be used with "output: export" config. --- app/blog/[board]/page.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/blog/[board]/page.tsx b/app/blog/[board]/page.tsx index e94d330..23d182f 100644 --- a/app/blog/[board]/page.tsx +++ b/app/blog/[board]/page.tsx @@ -4,9 +4,7 @@ import { Board, getBoards } from '#/lib/menu' import { compareDesc } from 'date-fns' export const generateStaticParams = async () => - getBoards().map((board: Board) => { - board: board.id - }) + getBoards().map((board: Board) => ({ board: board.id })) export const generateMetadata = ({ params }: { params: { board: string } }) => { const boardId = decodeURIComponent(params.board)