我正在尝试在 Cloudflare 页面上部署我的 NextJs 应用程序。该应用程序与 Supabase 后端有连接,我在其上设置了一些 Edge 功能,这些功能位于名为
supabase
的单独文件夹中。在cloudflare Pages上部署时,Supabase的Edge功能似乎有问题:
17:01:51.638 ▲ Creating an optimized production build ...
17:02:11.266 ▲ ✓ Compiled successfully
17:02:11.270 ▲ Linting and checking validity of types ...
17:02:14.705 ▲ Failed to compile.
17:02:14.706 ▲ ./supabase/functions/executeTrainings/index.ts:7:30
17:02:14.706 ▲ Type error: Cannot find module 'jsr:@supabase/supabase-js@2' or its corresponding type declarations.
17:02:14.706 ▲
17:02:14.706 ▲ 5 | // Setup type definitions for built-in Supabase Runtime APIs
17:02:14.706 ▲ 6 | import "jsr:@supabase/functions-js/edge-runtime.d.ts";
17:02:14.706 ▲ > 7 | import { createClient } from "jsr:@supabase/supabase-js@2";
17:02:14.706 ▲ | ^
17:02:14.707 ▲ 8 | import { DateTime } from "https://esm.sh/luxon";
17:02:14.707 ▲ 9 |
17:02:14.707 ▲ 10 | Deno.serve(async (req) => {
17:02:14.765 ▲ Error: Command "npm run build" exited with 1
17:02:14.806
17:02:14.807 ⚡️ The Vercel build (`npx vercel build`) command failed. For more details see the Vercel logs above.
是否可以排除此 supabase 文件夹,以便 cloudflare 不调查它?我还能做些什么来解决这个问题吗?我尝试创建 .cfignore 文件,但不起作用。
欢迎任何帮助!
我可以通过将目录名称
supabase
添加到 `tsconfig.json 中 export
键的值来排除它。
"exclude": ["node_modules", "supabase"]