payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
25.75k stars 1.64k forks source link

A virtual field cannot be used as the title report by 3.0.0-beta.113 #8648

Closed smoothdvd closed 1 month ago

smoothdvd commented 1 month ago

Link to reproduction

No response

Environment Info

Payload: 3.0.0-beta.113

Describe the Bug

webpack-internal:///(rsc)/../../node_modules/.pnpm/payload@3.0.0-beta.113_graphql@16.9.0_monaco-editor@0.52.0_react-dom@19.0.0-rc-3edc000d-20240_hnuwoywkic44rdfpsd7r2ubyjm/node_modules/payload/dist/collections/config/useAsTitle.js:34 throw new _errors_InvalidConfiguration_js__WEBPACK_IMPORTED_MODULE_0__.InvalidConfiguration(The field "${config.admin.useAsTitle}" specified in "admin.useAsTitle" in the collection "${config.slug}" is virtual. A virtual field cannot be used as the title.); ^

InvalidConfiguration: The field "fullTitle" specified in "admin.useAsTitle" in the collection "newspaper_pages" is virtual. A virtual field cannot be used as the title. at validateUseAsTitle (webpack-internal:///(rsc)/../../node_modules/.pnpm/payload@3.0.0-beta.113_graphql@16.9.0_monaco-editor@0.52.0_react-dom@19.0.0-rc-3edc000d-20240_hnuwoywkic44rdfpsd7r2ubyjm/node_modules/payload/dist/collections/config/useAsTitle.js:34:23) at sanitizeCollection (webpack-internal:///(rsc)/../../node_modules/.pnpm/payload@3.0.0-beta.113_graphql@16.9.0_monaco-editor@0.52.0_react-dom@19.0.0-rc-3edc000d-20240_hnuwoywkic44rdfpsd7r2ubyjm/node_modules/payload/dist/collections/config/sanitize.js:171:72) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async sanitizeConfig (webpack-internal:///(rsc)/../../node_modules/.pnpm/payload@3.0.0-beta.113_graphql@16.9.0_monaco-editor@0.52.0_react-dom@19.0.0-rc-3edc000d-20240_hnuwoywkic44rdfpsd7r2ubyjm/node_modules/payload/dist/config/sanitize.js:132:33) at async buildConfig (webpack-internal:///(rsc)/../../node_modules/.pnpm/payload@3.0.0-beta.113_graphql@16.9.0_monaco-editor@0.52.0_react-dom@19.0.0-rc-3edc000d-20240_hnuwoywkic44rdfpsd7r2ubyjm/node_modules/payload/dist/config/build.js:17:16) { data: null, isOperational: true, isPublic: false, status: 500,

}

Reproduction Steps

  1. create a virtual field
  2. use virtual field as title

Adapters and Plugins

No response

r1tsuu commented 1 month ago

This was intentionally done here https://github.com/payloadcms/payload/pull/8620. See https://github.com/payloadcms/payload/pull/8541#pullrequestreview-2357896259

github-actions[bot] commented 1 month ago

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.