Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Chore: Add actionable redeploy hint when function bundle retrieval fails (#46138)

Monica Khouryd83cc67760f8
diff --git a/apps/studio/pages/project/[ref]/functions/[functionSlug]/code.tsx b/apps/studio/pages/project/[ref]/functions/[functionSlug]/code.tsx
index d730efb3b9f..ff56dca50a8 100644
--- a/apps/studio/pages/project/[ref]/functions/[functionSlug]/code.tsx
+++ b/apps/studio/pages/project/[ref]/functions/[functionSlug]/code.tsx
@@ -14,6 +14,7 @@ import { PreventNavigationOnUnsavedChanges } from '@/components/ui-patterns/Dial
import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
import { FileExplorerAndEditor } from '@/components/ui/FileExplorerAndEditor'
import { FileData } from '@/components/ui/FileExplorerAndEditor/FileExplorerAndEditor.types'
+import { InlineLink } from '@/components/ui/InlineLink'
import { useEdgeFunctionBodyQuery } from '@/data/edge-functions/edge-function-body-query'
import { useEdgeFunctionQuery } from '@/data/edge-functions/edge-function-query'
import { useEdgeFunctionDeployMutation } from '@/data/edge-functions/edge-functions-deploy-mutation'
@@ -162,13 +163,31 @@ const CodePage = () => {
{isErrorLoadingFiles && (
<div className="flex flex-col items-center justify-center h-full bg-surface-200">
- <div className="flex flex-col items-center text-center gap-2 max-w-md">
+ <div className="flex flex-col items-center text-center gap-3 max-w-md">
<AlertCircle size={24} strokeWidth={1.5} className="text-amber-900" />
<h3 className="text-md mt-4">Failed to load function code</h3>
<p className="text-sm text-foreground-light">
{filesError?.message ||
'There was an error loading the function code. The format may be invalid or the function may be corrupted.'}
</p>
+ <div className="text-sm text-foreground-light border-t border-border-muted pt-3 mt-2">
+ <p className="font-medium mb-2">To resolve this issue:</p>
+ <ol className="text-left space-y-1">
+ <li>1. Update to the latest Supabase CLI version</li>
+ <li>
+ 2. Redeploy your function using:{' '}
+ <code className="text-xs bg-muted px-1 py-0.5 rounded">
+ supabase functions deploy
+ </code>
+ </li>
+ <li>
+ 3. Or use the{' '}
+ <InlineLink href="https://supabase.com/docs/reference/api/v1-deploy-a-function">
+ Management API
+ </InlineLink>
+ </li>
+ </ol>
+ </div>
</div>
</div>
)}