Skip to content

The open alternative to Salesforce, designed for AI.

fix(website): force-dynamic partner profiles to stop OpenNext 404 cache (#22120)

Rashad Karanouh500f441807db
diff --git a/packages/twenty-website/project.json b/packages/twenty-website/project.json
index ca84969c314..0fe0d98ad95 100644
--- a/packages/twenty-website/project.json
+++ b/packages/twenty-website/project.json
@@ -39,7 +39,7 @@
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
- "command": "node scripts/check-conventions.mjs && npx oxlint -c .oxlintrc.json . && npx oxfmt --check ."
+ "command": "node scripts/check-partners-marketplace-routes.mjs && node scripts/check-conventions.mjs && npx oxlint -c .oxlintrc.json . && npx oxfmt --check ."
},
"configurations": {
"fix": {
diff --git a/packages/twenty-website/scripts/check-partners-marketplace-routes.mjs b/packages/twenty-website/scripts/check-partners-marketplace-routes.mjs
new file mode 100644
index 00000000000..9f4e44154dc
--- /dev/null
+++ b/packages/twenty-website/scripts/check-partners-marketplace-routes.mjs
@@ -0,0 +1,31 @@
+import fs from 'fs';
+import path from 'path';
+import { fileURLToPath } from 'url';
+
+const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
+const routes = [
+ 'src/app/[locale]/(site)/partners/list/page.tsx',
+ 'src/app/[locale]/(site)/partners/profile/[slug]/page.tsx',
+];
+
+const failures = [];
+
+for (const relativePath of routes) {
+ const fullPath = path.join(root, relativePath);
+ const source = fs.readFileSync(fullPath, 'utf8');
+ if (!/export const dynamic = 'force-dynamic';/.test(source)) {
+ failures.push(
+ `${relativePath}: must export dynamic = 'force-dynamic' (OpenNext runtime fetch; build has no TWENTY_PARTNERS_API_KEY).`,
+ );
+ }
+}
+
+if (failures.length > 0) {
+ console.error('check-partners-marketplace-routes: FAILED');
+ for (const failure of failures) {
+ console.error(` ${failure}`);
+ }
+ process.exit(1);
+}
+
+console.log('check-partners-marketplace-routes: OK');
diff --git a/packages/twenty-website/src/app/[locale]/(site)/partners/profile/[slug]/page.tsx b/packages/twenty-website/src/app/[locale]/(site)/partners/profile/[slug]/page.tsx
index 3c8471ab8b1..cb84dd1eaf0 100644
--- a/packages/twenty-website/src/app/[locale]/(site)/partners/profile/[slug]/page.tsx
+++ b/packages/twenty-website/src/app/[locale]/(site)/partners/profile/[slug]/page.tsx
@@ -14,6 +14,8 @@ import { Menu } from '@/sections/menu';
type PartnerProfileParams = { locale: string; slug: string };
+export const dynamic = 'force-dynamic';
+
export const dynamicParams = true;
export async function generateStaticParams(): Promise<Array<{ slug: string }>> {