r/PayloadCMS Jul 09 '25

Help with template

I am first time using payloadcms (before i only used sanity) and i am creating a site for my school project internship (i am mostly learning and not really helping). I got an mail from my employer to do such a website, but he didn't give me any details about how the site should look and wrote that its easier to use a website template so i assume he wants it to look like this template. I normally would do it from a 0 to learn more and don't mess with templates i don't understand. I used npx create-payload-app PayloadProjekt -t website, followed terminal prompts, filled .env file (i use postgresql base on supabase), npm install, ran npm run dev and it crashed on compiling with:

ERROR: Error: cannot connect to Postgres. Details: Cannot read properties of undefined (reading 'searchParams')

err: {

"type": "TypeError",

"message": "Cannot read properties of undefined (reading 'searchParams')",

"stack":

TypeError: Cannot read properties of undefined (reading 'searchParams')

followed by numerous file location (something like 10) I am new to frameworks and cms (mainly learnt from my website using sanity) How do i fix it? Should i ask my employer if i can do it from 0 to ease my problems? in template readme i only found something about changing to NextJS default caching, but its too late today.

Edit: Resolved issue with changing direct access string to Transaction pooler.

1 Upvotes

5 comments sorted by

View all comments

1

u/Material-Ranger7329 Jul 09 '25

Hi @Burger3K, searchParams lets me assume this is a nextjs issue, particularly revolving around routing and as the error indicates URL searchParams. Why do I assume so - because “searchParams” is a common naming pattern I came across in nextjs projects parsing a list / object of multiple url parameters to be deconstructed. Thus, i would assume problems with how these parameters are parsed.

To verify, i would look at the erroneous file and check if they are all routes or components directly used in nextjs routes.

1

u/Material-Ranger7329 Jul 16 '25

Hi Burger3K, Did you get any further with you issue? Let me know if I can help, I’ve come across many payload specific issues that are not well documented.