nuxt-modules / supabase

Supabase module for Nuxt.
https://supabase.nuxtjs.org
MIT License
737 stars 130 forks source link

Supabase crush edge functions on vercel: This Edge Function has crashed. #258

Open 1bye opened 1 year ago

1bye commented 1 year ago

Version


Reproduction Link

Better it clone to vercel

Steps to reproduce

Add SUPABASE_URL and SUPABASE_KEY

  1. Reproduce it to vercel, with nuxt/supabase then without Links to vercel:

What is Expected?

Work with nitro preset vercel-edge

What is actually happening?

Crushing vercel edge functions

image

reidkolaczek commented 1 year ago

Spent forever trying to solve this for vercel. I tried just using supabase-js as well as older versions. What finally fixed it for me is removing the vercel preset from the nitro options in the nuxt.config.js.

When you build it on vercel it still is picked up as the vercel preset. This leads me to believe it is an issue with Nitro. Do not set any preset as nitro will detect that it is vercel when deploying.

nitro: {
    // preset: 'vercel-edge',
  },
Pixel-Panda commented 1 month ago

Spent forever trying to solve this for vercel. I tried just using supabase-js as well as older versions. What finally fixed it for me is removing the vercel preset from the nitro options in the nuxt.config.js.

When you build it on vercel it still is picked up as the vercel preset. This leads me to believe it is an issue with Nitro. Do not set any preset as nitro will detect that it is vercel when deploying.


nitro: {

    // preset: 'vercel-edge',

  },

This happens without nitro. I have this in my json file

{ "name": "nextjs", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev", "build": "npx drizzle-kit migrate && next build", "start": "next start", "lint": "next lint", "db:generate": "drizzle-kit generate", "db:migrate": "drizzle-kit push", "db:push": "drizzle-kit push", "db:studio": "drizzle-kit studio" }, "dependencies": { "@radix-ui/react-dropdown-menu": "^2.1.1", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-slot": "^1.1.0", "@supabase/auth-ui-react": "^0.4.7", "@supabase/auth-ui-shared": "^0.1.8", "@supabase/ssr": "^0.5.0", "@supabase/supabase-js": "^2.45.1", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "dotenv": "^16.4.5", "drizzle-kit": "^0.24.2", "drizzle-orm": "^0.33.0", "lucide-react": "^0.428.0", "next": "14.2.5", "postgres": "^3.4.4", "react": "^18", "react-dom": "^18", "react-icons": "^5.3.0", "stripe": "^16.9.0", "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7" }, "devDependencies": { "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "eslint": "^8", "eslint-config-next": "14.2.5", "postcss": "^8", "tailwindcss": "^3.4.1", "typescript": "^5" } }