nextjs-subscription-payments icon indicating copy to clipboard operation
nextjs-subscription-payments copied to clipboard

Issues with local development

Open honocoder opened this issue 1 year ago • 1 comments

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!

honocoder avatar Aug 08 '23 15:08 honocoder

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

gaceladri avatar Sep 26 '23 10:09 gaceladri