[알게된 것] Next.js 'use server' 오류

Chobby·2023년 10월 11일
2

알게된 것

목록 보기
13/50

😀문제상황

×To use Server Actions, please enable the feature flag in your Next.js config.
오류가 발생함


😁해결방법

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    serverActions: true,
  },
};

module.exports = nextConfig;

next.config.js 파일에 experimental 속성을 다음과 같이 정의함

profile
내 지식을 공유할 수 있는 대담함

0개의 댓글