You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Supabase Edge函数本地开发报错:无法分配请求的地址

Supabase本地Edge函数调试出现tcp连接错误(os error 99)

问题场景

  • 基于Supabase BaaS开发并部署了多个Edge函数,按官方文档拉取镜像运行Supabase栈后,启动流程无明显报错
  • 请求自定义Edge函数http://localhost:8000/users时触发错误:
    error sending request for url (http://localhost:8000/users): error trying to connect: tcp connect error: Cannot assign requested address (os error 99)
    
  • 测试默认hello-world函数可正常响应:
    % curl --request POST 'http://localhost:54321/functions/v1/hello-world' \ 
    --header 'Authorization: Bearer <anon key>' \ 
    --header 'Content-Type: application/json' \ 
    --data '{ "name":"Functions" }'
    {"message":"Hello Functions!"}% 
    
  • 曾怀疑是Docker端口暴露问题,但缺乏相关排查经验

解决方法

错误根源并非Docker端口配置问题,而是目标Edge函数(/users)部署失败——部署阶段存在未被察觉的报错,导致函数未成功注册到本地Supabase栈,进而引发连接错误。修复函数部署故障(如代码语法错误、依赖缺失、权限配置问题等)并重新部署后,请求可正常执行。

内容的提问来源于stack exchange,提问作者Adrian Brenne

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.01 12:10:29