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

IntelliJ中Supabase Edge Functions的Deno智能提示与部署问题

解决Supabase Edge Functions开发中的Deno智能提示缺失与部署报错问题

一、修复IntelliJ中的Deno智能提示问题

  • 确认Deno插件状态:打开Settings > Plugins,确保Deno插件已激活,重启IDE生效。
  • 配置项目级Deno文件:在Supabase项目根目录创建或编辑deno.json,添加以下内容:
    {
      "importMap": "./import_map.json",
      "compilerOptions": {
        "lib": ["deno.window"]
      }
    }
    
  • 关联Deno配置到IDE:打开Settings > Languages & Frameworks > Deno,勾选Enable Deno,并将Deno configuration file指向根目录的deno.json。
  • 设置函数目录为Deno源根:右键点击functions/get-ticket-information目录,选择Mark Directory as > Deno Sources Root。
  • 刷新IDE缓存:执行File > Invalidate Caches...,选择Invalidate and Restart,重启后智能提示即可恢复。

二、修复部署时的"Relative import path 'http'"报错

报错源于Stripe的类型依赖引用了Node.js的http裸导入,Deno无法识别未映射的裸模块。修改import_map.json补充映射:

{
  "imports": {
    "stripe": "https://esm.sh/stripe@11.12.0?target=deno&no-check",
    "std/server": "https://deno.land/std@0.177.0/http/server.ts",
    "http": "https://esm.sh/@types/node@16.18.12/http",
    "https": "https://esm.sh/@types/node@16.18.12/https"
  }
}
  • 关键调整:
    • 给Stripe的导入添加&no-check参数,跳过esm.sh的跨环境类型检查,避免额外冲突。
    • 显式映射Node的http和https模块,解决裸导入路径问题。
  • 重新执行部署命令:
    supabase functions deploy --no-verify-jwt get-ticket-information --debug
    

内容的提问来源于stack exchange,提问作者Markus G.

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.30 13:18:13