Skip to content

Payload Admin 500 on Custom Domain in Vercel Despite CSRF/CORS Config #13406

@imrankhanjoya

Description

@imrankhanjoya

Describe the Bug

Payload admin panel works fine on Vercel preview URL but throws 500 on custom domain (onionpose.com).
I set serverURL, updated CSRF and CORS lists, and redeployed — still no change.
Env var is set to SERVER_URL=https://onionpose.com for production, yet Payload appears to still bundle admin panel for preview domain or reject CSRF from custom domain.
Error log
⨯ TypeError: Cannot read properties of undefined (reading 'id') at d (/var/task/.next/server/chunks/8549.js:1:10273) at nC (/var/task/node_modules/.pnpm/[email protected][email protected]_react-_5f6q75h2dzprt4skqwjuf4pdzm/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:42763) at nE (/var/task/node_modules/.pnpm/[email protected][email protected]_react-_5f6q75h2dzprt4skqwjuf4pdzm/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:44535) at nE (/var/task/node_modules/.pnpm/[email protected][email protected]_react-_5f6q75h2dzprt4skqwjuf4pdzm/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:59297) at nA (/var/task/node_modules/.pnpm/[email protected][email protected]_react-_5f6q75h2dzprt4skqwjuf4pdzm/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:62303) at nP (/var/task/node_modules/.pnpm/[email protected][email protected]_react-_5f6q75h2dzprt4skqwjuf4pdzm/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:59946) at nO (/var/task/node_modules/.pnpm/[email protected][email protected]_react-_5f6q75h2dzprt4skqwjuf4pdzm/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:65184) at nj (/var/task/node_modules/.pnpm/[email protected][email protected]_react-_5f6q75h2dzprt4skqwjuf4pdzm/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:64414) at nA (/var/task/node_modules/.pnpm/[email protected][email protected]_react-_5f6q75h2dzprt4skqwjuf4pdzm/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:62567) at nP (/var/task/node_modules/.pnpm/[email protected][email protected]_react-_5f6q75h2dzprt4skqwjuf4pdzm/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:59946) { digest: '1477207072' }

Please help

Link to the code that reproduces this issue

https://onionpose.com/admin

Reproduction Steps

https://onionpose.com/admin

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

area: core

Environment Info

[email protected] payload /Users/imran/Documents/GitHub/onionposecms
> payload "info"


Binaries:
  Node: 23.5.0
  npm: 11.2.0
  Yarn: 1.22.22
  pnpm: 8.6.2
Relevant Packages:
  payload: 3.0.0-canary.0374de4
  next: 15.0.0-canary.104
  @payloadcms/db-mongodb: 3.0.0-canary.0374de4
  @payloadcms/db-postgres: 3.0.0-canary.0374de4
  @payloadcms/graphql: 3.0.0-canary.0374de4
  @payloadcms/next/utilities: 3.0.0-canary.0374de4
  @payloadcms/plugin-cloud-storage: 3.0.0-canary.0374de4
  @payloadcms/richtext-lexical: 3.0.0-canary.0374de4
  @payloadcms/richtext-slate: 3.0.0-canary.0374de4
  @payloadcms/storage-uploadthing: 3.0.0-canary.0374de4
  @payloadcms/storage-vercel-blob: 3.0.0-canary.0374de4
  @payloadcms/translations: 3.0.0-canary.0374de4
  @payloadcms/ui/shared: 3.0.0-canary.0374de4
  react: 19.0.0-rc-06d0b89e-20240801
  react-dom: 19.0.0-rc-06d0b89e-20240801
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Fri Jul  5 17:56:39 PDT 2024; root:xnu-10063.141.1~2/RELEASE_ARM64_T8122
  Available memory (MB): 8192
  Available CPU cores: 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions