Unverified Commit eaea2084 authored by Shu Ding's avatar Shu Ding Committed by GitHub

Error in `next export` when `serverActions` is enabled (#49959)

Since a server is always required for Server Actions, they won't work
with static exports at all.
fix NEXT-634
Co-authored-by: 's avatarJiachi Liu <inbox@huozhi.im>
parent c7e5d767
...@@ -228,6 +228,12 @@ export default async function exportApp( ...@@ -228,6 +228,12 @@ export default async function exportApp(
) )
} }
if (nextConfig.experimental.serverActions) {
throw new ExportError(
`Server Actions are not supported with static export.`
)
}
const customRoutesDetected = ['rewrites', 'redirects', 'headers'].filter( const customRoutesDetected = ['rewrites', 'redirects', 'headers'].filter(
(config) => typeof nextConfig[config] === 'function' (config) => typeof nextConfig[config] === 'function'
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment