generated from payloadcms/plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I was using this plugin (slug field specifically) in development with an already initialized payload. Worked fine. When deployed to an empty project it threw an error. Reproduced with empty project.
Steps to reproduce
- Start new payload project
npx create-payload-app@latest - Add better fields
yarn add @nouance/payload-better-fields-plugin - Add slug field to users collection
import { CollectionConfig } from 'payload/types'
import { SlugField } from '@nouance/payload-better-fields-plugin'
const Users: CollectionConfig = {
slug: 'users',
auth: true,
admin: {
useAsTitle: 'email',
},
fields: [
{
name: 'title',
type: 'text',
},
...SlugField(
{
name: 'slug',
admin: {
position: 'sidebar',
},
},
{
useFields: ['title', 'subtitle'],
},
),
],
}
export default Users
- Run docker
docker-compose upand open localhost:3000
Error reports Component.js:78 Uncaught TypeError: Cannot read properties of undefined (reading 'value') pointing to this line return fields .filter(function (item) { return Boolean(item.value); })
Metadata
Metadata
Assignees
Labels
No labels