Skip to content

Commit

Permalink
fix: Fix generateStacitParams in [board]/page.tsx
Browse files Browse the repository at this point in the history
소괄호로 객체를 감싸는 것을 깜빡해서 에러가 발생
generateStaticParams가 제대로 된 배열을 반환하지 않으니
빌드 시 아래 에러 메시지가 뜸

Error: Page "/blog/[board]" is missing "generateStaticParams()"
so it cannot be used with "output: export" config.
  • Loading branch information
paulcjy committed Dec 8, 2023
1 parent 41360be commit ce0dada
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/blog/[board]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ce0dada

Please sign in to comment.