vercel / nextjs-subscription-payments

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

Empty NEXT_PUBLIC_SITE_URL env var breaks checkout in local testing #269

Closed chriscarrollsmith closed 4 months ago

chriscarrollsmith commented 7 months ago

The example .env.local file contains this text:

# Update this with your stable site URL only for the production environment.
NEXT_PUBLIC_SITE_URL=

If the user leaves this variable empty rather than deleting it, the template fails to create a checkout session during local testing. That's because getURL in 'helpers.ts' is only using the localhost fallback when NEXT_PUBLIC_SITE_URL is non-existent, not when it's empty.

leerob commented 4 months ago

https://github.com/vercel/nextjs-subscription-payments/pull/278