Skip to content

Unable to deploy Edge Function

如果你在部署 Edge Function 时遇到问题,可以按照这些步骤来诊断和解决问题。

🌐 If you're having trouble deploying an Edge Function, follow these steps to diagnose and resolve the issue.

查出问题 #

🌐 Diagnose the issue

  1. 检查函数语法: 在本地对你的函数文件运行 deno check
  2. 检查依赖: 确认所有导入的内容都可以访问并且与 Deno 兼容
  3. 检查包大小: 大函数可能无法部署
1
# Check for syntax errors
2
deno check ./supabase/functions/your-function/index.ts
3
4
# Deploy with verbose output
5
supabase functions deploy your-function --debug

常见原因 #

🌐 Common causes

  • 语法错误: 你的函数代码里 TypeScript 或 JavaScript 的语法问题
  • 无效的导入: 导入不存在或与 Deno 不兼容的模块
  • 大型包大小: 函数的源代码限制为10MB。更多详情请参见 包大小问题
  • 网络问题: 部署过程中无法访问 Supabase API

在提交支持请求之前 #

🌐 Before opening a support ticket

确保你使用的是最新版本的 Supabase CLI:

🌐 Make sure you're using the latest version of the Supabase CLI:

1
supabase --version
2
supabase update

如果这些步骤不能解决问题,请通过 Supabase 仪表板提交支持工单,并附上诊断命令的所有输出。

🌐 If these steps don't resolve the issue, open a support ticket via the Supabase Dashboard and include all output from the diagnostic commands.

额外资源 #

🌐 Additional resources