next.js在方法中使用“use server”的时候出现
Server Actions require `experimental.serverActions` optionto be enabled in your Next.js.config
在next.config.js中加入这段话:第3行到第5行。
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverActions: true
}
}
module.exports = nextConfig
重启项目