@@ -12,13 +15,39 @@ const NotFound = () => {
Logo={NoAccessLogo}
title={t('landingPage.noAccess.title')}
description={
-
- {t('publish.createWithAppFlowy')}
-
-
{t('publish.fastWithAI')}
-
{t('publish.tryItNow')}
+ <>
+ {publishError && (
+
+
{t('landingPage.noAccess.title')}
+
{publishError.message}
+ {publishError.detail && (
+
{publishError.detail}
+ )}
+ {(publishError.namespace || publishError.publishName) && (
+
+ {publishError.namespace && (
+ <>
+ Namespace: {publishError.namespace}
+ >
+ )}
+ {publishError.publishName && (
+ <>
+ {' '}
+ ยท Publish page: {publishError.publishName}
+ >
+ )}
+
+ )}
+
+ )}
+
+ {t('publish.createWithAppFlowy')}
+
+
{t('publish.fastWithAI')}
+
{t('publish.tryItNow')}
+
-
+ >
}
primaryAction={{
onClick: () => window.open('https://appflowy.com/download', '_self'),
diff --git a/src/utils/publish-error.ts b/src/utils/publish-error.ts
new file mode 100644
index 00000000..9cfe76c2
--- /dev/null
+++ b/src/utils/publish-error.ts
@@ -0,0 +1,22 @@
+export type PublishErrorPayload = {
+ code: 'NO_DEFAULT_PAGE' | 'PUBLISH_VIEW_LOOKUP_FAILED' | 'FETCH_ERROR' | 'UNKNOWN_FALLBACK';
+ message: string;
+ namespace?: string;
+ publishName?: string;
+ response?: unknown;
+ detail?: string;
+};
+
+declare global {
+ interface Window {
+ __APPFLOWY_PUBLISH_ERROR__?: PublishErrorPayload;
+ }
+}
+
+export const getPublishError = (): PublishErrorPayload | undefined => {
+ if (typeof window === 'undefined') {
+ return undefined;
+ }
+
+ return window.__APPFLOWY_PUBLISH_ERROR__;
+};
diff --git a/tsconfig.json b/tsconfig.json
index 0e105e6c..e6cdf888 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -53,7 +53,7 @@
"vite.config.ts",
"cypress.config.ts",
"cypress",
- "deploy/server.ts"
+ "deploy/**/*.ts"
],
"exclude": [
"node_modules",