-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
status: verifiedIf an issue has been reproducedIf an issue has been reproduced
Description
Describe the Bug
When using Payload CMS with Next.js, the error name changes after build:
- In
next dev:"name": "ValidationError" - In
next start:"name": "o"
This happens because Next.js minifies class names in production.
Solution
Disable server-side minification in next.config.js:
/** @type {import('next').NextConfig} */
const nextConfig = {
distDir: 'dist',
experimental: {
serverMinification: false,
},
}Link to the code that reproduces this issue
https://github.com/payloadcms/payload/blob/main/.github/reproduction-guide.md
Reproduction Steps
next build
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
"@payloadcms/db-postgres": "^3.50.0",
"@payloadcms/next": "^3.50.0",
"@payloadcms/ui": "^3.50.0",
"next": "15.1.5",
"payload": "^3.50.0",
rjohnsonbade-corrivium, vnava-corrivium and mulfyx
Metadata
Metadata
Assignees
Labels
status: verifiedIf an issue has been reproducedIf an issue has been reproduced