payloadcms / payloadcms/payload

templates/website: DATABASE_URI in .env doesn't match DATABASE_URL in payload.config.ts

Open
#16,460 2 comments 0 reactions 1 assignee View on GitHub

@AlessioGr is already working on this.

Since May 4, 2026.

area: templates v3
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the Bug

Describe the Bug

When creating a new project using the website template, the generated .env contains DATABASE_URI,
but payload.config.ts references process.env.DATABASE_URL.
This mismatch causes a connection error on the first pnpm run dev.

Steps to Reproduce

  1. Run pnpx create-payload-app@latest and select the website template
  2. Set up .env based on .env.example with a valid postgres connection string as DATABASE_URI
  3. Start a local Postgres instance
  4. Run pnpm run dev

Expected Behavior

The app connects to Postgres successfully.

Actual Behavior

Error: cannot connect to Postgres: SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string

Root cause: .env.example uses DATABASE_URI but payload.config.ts reads process.env.DATABASE_URL.

Fix

Either update templates/website/payload.config.ts to use process.env.DATABASE_URI,
or update templates/website/.env.example to use DATABASE_URL.

Related

PR #11740 fixed the same issue for templates/with-postgres and templates/with-vercel-postgres,
but templates/website was not included in that fix.

Environment

  • payload: 3.84.1
  • OS: macOS
Link to the code that reproduces this issue

https://github.com/payloadcms/payload/tree/main/templates/website

Reproduction Steps
  1. Run pnpx create-payload-app@latest and select the website template
  2. Set up .env based on .env.example with a valid postgres connection string as DATABASE_URI
  3. Start a local Postgres instance
  4. Run pnpm run dev
Which area(s) are affected?

area: templates

Environment Info
Binaries:
  Node: 25.8.1
  npm: 11.11.0
  Yarn: N/A
  pnpm: 10.32.1
Relevant Packages:
  payload: 3.84.1
  next: 16.2.3
  @payloadcms/db-postgres: 3.84.1
  @payloadcms/drizzle: 3.84.1
  @payloadcms/graphql: 3.84.1
  @payloadcms/live-preview: 3.84.1
  @payloadcms/live-preview-react: 3.84.1
  @payloadcms/next/utilities: 3.84.1
  @payloadcms/plugin-form-builder: 3.84.1
  @payloadcms/plugin-nested-docs: 3.84.1
  @payloadcms/plugin-redirects: 3.84.1
  @payloadcms/plugin-search: 3.84.1
  @payloadcms/plugin-seo: 3.84.1
  @payloadcms/richtext-lexical: 3.84.1
  @payloadcms/translations: 3.84.1
  @payloadcms/ui/shared: 3.84.1
  react: 19.2.4
  react-dom: 19.2.4
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.4.0: Thu Mar 19 19:33:43 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T8142
  Available memory (MB): 16384
  Available CPU cores: 10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.