-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
Description
Describe the Bug
v3.2.0 seems to have introduced some error that surfaces on production builds.
Versions prior that version don't have that issue.
While the admin panel seems to work properly, the document is returned with a Status 500 and the server throws:
ReferenceError: CSS is not defined
at /Users/someuser/Fiddles/test-payload/.next/server/app/(payload)/admin/[[...segments]]/page.js:43:52079
at Object.ne [as useMemo] (/Users/someuser/Fiddles/test-payload/node_modules/.pnpm/next@15.0.0_react-dom@19.0.0-rc-65a56d0e-20241020_react@19.0.0-rc-65a56d0e-20241020/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:36390)
at t.useMemo (/Users/someuser/Fiddles/test-payload/node_modules/.pnpm/next@15.0.0_react-dom@19.0.0-rc-65a56d0e-20241020_react@19.0.0-rc-65a56d0e-20241020/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:68:6677)
at ae (/Users/someuser/Fiddles/test-payload/.next/server/app/(payload)/admin/[[...segments]]/page.js:43:52060)
at at (/Users/someuser/Fiddles/test-payload/.next/server/app/(payload)/admin/[[...segments]]/page.js:43:53220)
at nj (/Users/someuser/Fiddles/test-payload/node_modules/.pnpm/next@15.0.0_react-dom@19.0.0-rc-65a56d0e-20241020_react@19.0.0-rc-65a56d0e-20241020/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:45788)
at nO (/Users/someuser/Fiddles/test-payload/node_modules/.pnpm/next@15.0.0_react-dom@19.0.0-rc-65a56d0e-20241020_react@19.0.0-rc-65a56d0e-20241020/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:47563)
at nN (/Users/someuser/Fiddles/test-payload/node_modules/.pnpm/next@15.0.0_react-dom@19.0.0-rc-65a56d0e-20241020_react@19.0.0-rc-65a56d0e-20241020/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:65362)
at nM (/Users/someuser/Fiddles/test-payload/node_modules/.pnpm/next@15.0.0_react-dom@19.0.0-rc-65a56d0e-20241020_react@19.0.0-rc-65a56d0e-20241020/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:62993)
at nH (/Users/someuser/Fiddles/test-payload/node_modules/.pnpm/next@15.0.0_react-dom@19.0.0-rc-65a56d0e-20241020_react@19.0.0-rc-65a56d0e-20241020/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:20:68775) {
digest: '1122664388'
}
I also tried switching between nextjs 15 minor versions and react 19 rc versions, made no difference.
I suspect that some code meant for the client gets bundled server side.
Link to the code that reproduces this issue
pnpm dlx create-payload-app
Reproduction Steps
pnpm dlx create-payload-app
pnpm build
pnpm start
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
Probably not OS specific, happens both on macOS and Linux.
Node.js v22.2.0
Binaries:
Node: 22.2.0
npm: 10.7.0
Yarn: N/A
pnpm: 8.15.1
Relevant Packages:
payload: 3.2.0
next: 15.0.0
@payloadcms/email-nodemailer: 3.2.0
@payloadcms/graphql: 3.2.0
@payloadcms/next/utilities: 3.2.0
@payloadcms/payload-cloud: 3.2.0
@payloadcms/richtext-lexical: 3.2.0
@payloadcms/translations: 3.2.0
@payloadcms/ui/shared: 3.2.0
react: 19.0.0-rc-65a56d0e-20241020
react-dom: 19.0.0-rc-65a56d0e-20241020
JustDylan23paulpopus