payloadcms / payloadcms/payload

generateStaticParams with pgsql spam pulls database during dev

Open
#9,469 9 comments 4 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

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

Description

Describe the Bug

I'm developing an app using postgres as the db provider. I have a page with a dynamic route segment: /products/[slug]. During local development, when exporting a generateStaticParams function inside of this page, [⣻] Pulling schema from database... is being spammed at an alarming rate:
Image.
This happens upon every page refresh.

Image

Link to the code that reproduces this issue

https://github.com/Wtiben/payload-generateStaticParams-demo

Reproduction Steps

Checkout the repo and run docker compose up.
Navigate to a random product page, for example: http://localhost:3000/products/abc.

Upon page load the schema is being pulled from database repeatedly:
Image

In this simple example the amount of spam appears to be limited and i'm not exactly sure which factors worsen it, but it's still observable. In a real-life app, it's considerably worse.

Which area(s) are affected? (Select all that apply)

db-postgres, area: core

Environment Info
Binaries:
  Node: 23.1.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  payload: 3.1.0
  next: 15.0.0
  @payloadcms/db-postgres: 3.1.0
  @payloadcms/email-nodemailer: 3.1.0
  @payloadcms/graphql: 3.1.0
  @payloadcms/next/utilities: 3.1.0
  @payloadcms/payload-cloud: 3.1.0
  @payloadcms/richtext-lexical: 3.1.0
  @payloadcms/translations: 3.1.0
  @payloadcms/ui/shared: 3.1.0
  react: 19.0.0-rc-65a56d0e-20241020
  react-dom: 19.0.0-rc-65a56d0e-20241020
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Enterprise
  Available memory (MB): 65452
  Available CPU cores: 16

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.