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
- 检查函数语法: 在本地对你的函数文件运行
deno check - 检查依赖: 确认所有导入的内容都可以访问并且与 Deno 兼容
- 检查包大小: 大函数可能无法部署
1# Check for syntax errors2deno check ./supabase/functions/your-function/index.ts34# Deploy with verbose output5supabase 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:
1supabase --version2supabase 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