nextjs-framework
  • nextjs-sj-prime-base
  • Getting Started
    • Quickstart
    • Project Structure
    • Code Convention
  • 신규 프로젝트 생성 가이드
  • 라이브러리 개발 및 배포
  • # 고고컴퍼니 어드민 개발 서버 배포
  • Port 설정 방법
  • 에러 해결 방법
  • StoryBook 설명
  • COMPONENTS/UI
    • Tooltip
    • CompactIconButton
    • IconButton
    • FormAsset
    • InputField
    • Dropzone
    • Select
    • DataTable
    • TableHead
    • TableHeadDropdownMenu
    • TableCell
    • TableCellSelect
    • Tag
    • Tabs
    • Chip
    • Command
    • FilterSelect
    • FilterMultiSelect
    • FilterDate
    • DatePicker
    • Toast
  • Timer
  • Components/layout
    • page-header
    • info-card
    • search-filter
    • table-header
    • form
  • Custom Hook
    • use-form
  • use-form-file
  • use-timer
  • Util
    • validation
    • middleware.ts
  • Components/미사용
    • input-box
    • single-select
    • multi-select
    • range-date-picker
    • radio-button-group
    • checkbox-group
    • list-table
    • pagination
    • toggle
Powered by GitBook
On this page

에러 해결 방법

PreviousPort 설정 방법NextStoryBook 설명

Last updated 1 month ago

  1. 서버 컴포넌트 빌드 에러

# pnpm run build
Error: Dynamic server usage: Route /product/create couldn't be rendered statically because it used `cookies`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
    at v (.next/server/chunks/943.js:46:18951)
    at d (.next/server/chunks/726.js:1:46755)
    at <unknown> (.next/server/chunks/835.js:1:20108)
    at async aD.request (.next/server/chunks/726.js:3:21187)
    at async a (.next/server/app/product/create/page.js:1:5338) {
  description: "Route /product/create couldn't be rendered statically because it used `cookies`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error",
  digest: 'DYNAMIC_SERVER_USAGE'
}
  • 빌드 시 위와 같은 에러가 발생할 경우 에러 메시지 상의 Route 경로의 페이지 파일을 찾아 파일 최상단에 아래 코드 추가

export const dynamic = 'force-dynamic' // 페이지를 강제로 동적 렌더링으로 설정

  1. use client 에러

  • 에러가 발생한 컴포넌트 최상단에 'use client' 코드 추가