From 29dc7ccb1a4e4828faba1c42226c436eb58505a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Mon, 3 Mar 2025 17:05:46 +0100 Subject: [PATCH] Fix next.js configuration for serverActions --- packages/gitbook-v2/next.config.mjs | 6 ++++++ packages/gitbook-v2/open-next.config.ts | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/gitbook-v2/next.config.mjs b/packages/gitbook-v2/next.config.mjs index f3d6ae78e..acf792d56 100644 --- a/packages/gitbook-v2/next.config.mjs +++ b/packages/gitbook-v2/next.config.mjs @@ -6,6 +6,12 @@ const nextConfig = { experimental: { useCache: true, + serverActions: { + // Allow all origins for server actions + // as we serve content on a lot of domains + // Server actions are secured by the middleware. + allowedOrigins: ['*', '*.*', '*.*.*', '*.*.*.*', '*.*.*.*.*'], + }, }, env: { diff --git a/packages/gitbook-v2/open-next.config.ts b/packages/gitbook-v2/open-next.config.ts index 27ebb6331..a52461857 100644 --- a/packages/gitbook-v2/open-next.config.ts +++ b/packages/gitbook-v2/open-next.config.ts @@ -25,12 +25,6 @@ const config = { dangerous: { enableCacheInterception: false, }, - - experimental: { - serverActions: { - allowedOrigins: ['*', '*.*', '*.*.*', '*.*.*.*', '*.*.*.*.*'], - }, - }, }; export default config;