timothymiller / t4-app

A powerful cross-platform UI toolkit for building actually native iOS, Android, macOS, Windows, Linux, and Progressive Web Apps with React (Native).
https://t4stack.com
MIT License
1.31k stars 69 forks source link

NextJs env variables missing in .env.example for localhost (vs PUBLIC_ variables) #113

Closed guioum closed 7 months ago

guioum commented 7 months ago

Current .env.example use PUBLIC_ variables for configuration. In localhost dev, if we use only these variables, then supabase doesn't work, and images are broken.

# 🛎️ For local dev
# 👉 Rename this file to .env.local
# 👉 Fill in the values below.

# Expo & Next.js)
PUBLIC_API_URL=http://localhost:8787
PUBLIC_APP_URL=http://localhost:3000
PUBLIC_SUPABASE_ANON_KEY=
PUBLIC_SUPABASE_URL=
PUBLIC_SUPPORT_EMAIL=
PUBLIC_METADATA_NAME="T4 App"
PUBLIC_METADATA_DESCRIPTION="Type-Safe, Full-Stack Starter Kit for React Native + Web."
PUBLIC_EAS_OWNER="timothymiller"
PUBLIC_EAS_PROJECT_ID="85fc6ccd-0ce1-4e4d-804c-b15df989f97e"

# Cloudflare Wrangler
JWT_VERIFICATION_KEY=
DATABASE_ID=aa5e3923-0f1b-469a-8bb8-d10fb866efe0

Had to add this to my .env.local (as per documentation):

# For backwards compatibility
NEXT_PUBLIC_API_URL=http://localhost:8787
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_SUPABASE_URL=xxxx
NEXT_PUBLIC_SUPABASE_ANON_KEY=xxxx
NEXT_PUBLIC_SUPPORT_EMAIL=xxxx

Thanks, great project, love it.

timothymiller commented 7 months ago

I'm linking an answer I gave in this issue.

Let me know if definine them that way and then running bun install fixes things for you!

guioum commented 7 months ago

I am moving forward and closing this issue (bun install did the job), but I still think #115 needs to be checked.