vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
6.4k stars 1.3k forks source link

Issues with local development #229

Open honocoder opened 1 year ago

honocoder commented 1 year ago

Hi,

I followed the step-by-step guide, and everything seems to work well in production. But, when I want to work with a local version, it's getting tougher.

I also followed the guide, using Vercel and Stripe CLIs, but when I run npm run dev, I have this error showing up:

Error: either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!

I double checked my env variables, my Supabase createClient() and everything seems to be good.

supabase-admin.ts

const supabaseAdmin = createClient<Database>(
  process.env.NEXT_PUBLIC_SUPABASE_URL || '',
  process.env.SUPABASE_SERVICE_ROLE_KEY || ''
);

Did you guys already have this issue and found a solution?

Thanks in advance!

gaceladri commented 1 year ago

You have to rename your .env.local.example file to .env.local