CriticalMoments/CMSaasStarter

Internal error viewing home and pricing page

keybits opened this issue · 4 comments

Thanks for your work on this great project.

I've cloned the repo and configured it as per the README. I can create a user account and can see pages at:

http://localhost:5173/blog
http://localhost:5173/contact_us
http://localhost:5173/login
and
http://localhost:5173/account

^ all work correctly

However when I navigate to the home or pricing pages (http://localhost:5173/ or http://localhost:5173/pricing) I get:

image

"This is embarassing...
There was an error: Internal Error"

In the console I see:

image
The next HMR update will cause the page to reload
<Root> was created without expected prop 'form'

I haven't made any other changes. Tested with node 18.6.0 and 20.11.1

Any thoughts on what's causing this?

Hmm, saasstarter.work is running of main and it works, so this is likely a config issue. Can you share the env vars you have set (list, not values for private ones obviously).

Try renaming export let form: FormAccountUpdateResult in create_profile and see if the error changes name. That's the only prop "form" I see.

.env.local contains:

PUBLIC_SUPABASE_URL=https://xxx.supabase.co
PUBLIC_SUPABASE_ANON_KEY=xxx
PRIVATE_SUPABASE_SERVICE_ROLE=xxx
PRIVATE_STRIPE_API_KEY=xxx

Tried changing export let form: FormAccountUpdateResult - changed form to formtest - but the error is the same.

aha - I was missing PUBLIC_SITE_NAME in .env.local

Added PUBLIC_SITE_NAME=https://localhost:5173 and all working now.

Perhaps make it clearer that's needed in the Local Development section of README?

Thanks again for making this - very useful!

@keybits glad it's fixed. Make sure to change that PUBLIC_SITE_NAME to user friendly name in prod. It's an actual name, not a base URL. It will appear in the <title> tag and a few other places to end users.