Comments (3)
having the same error, except for me the application doesn't start all. Here's my code.
UploadFeature({
collections: {
media: {
fields: [
{
name: "caption",
label: "Caption",
type: "richText",
editor: lexicalEditor({
features: () => [
ParagraphFeature(),
...defaultCMSFeatures,
],
}),
},
],
},
},
}),
Stack:
file:///home/alien/sites/rwarri.org/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]__@[email protected][email protected][email protected]/node_modules/payload/dist/fields/hooks/afterRead/promise.js:23
const shouldHoistLocalizedValue = flattenLocales && fieldAffectsData(field) && typeof siblingDoc[field.name] === 'object' && siblingDoc[field.name] !== null && field.localized && locale !== 'all' && req.payload.config.localization;
^
TypeError: Cannot read properties of null (reading 'caption')
at promise (file:///home/alien/sites/rwarri.org/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]__@[email protected][email protected][email protected]/node_modules/payload/dist/fields/hooks/afterRead/promise.js:23:101)
at file:///home/alien/sites/rwarri.org/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]__@[email protected][email protected][email protected]/node_modules/payload/dist/fields/hooks/afterRead/traverseFields.js:4:28
at Array.forEach (<anonymous>)
at Module.traverseFields (file:///home/alien/sites/rwarri.org/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]__@[email protected][email protected][email protected]/node_modules/payload/dist/fields/hooks/afterRead/traverseFields.js:3:12)
at hooks.afterRead (/home/alien/sites/rwarri.org/node_modules/.pnpm/@[email protected]_oya34g7zejj37344dtca3uxyqm/node_modules/@payloadcms/richtext-lexical/dist/index.js:286:59)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///home/alien/sites/rwarri.org/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]__@[email protected][email protected][email protected]/node_modules/payload/dist/fields/hooks/afterRead/promise.js:515:49
at async promise (file:///home/alien/sites/rwarri.org/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]__@[email protected][email protected][email protected]/node_modules/payload/dist/fields/hooks/afterRead/promise.js:477:21)
at async Promise.all (index 6)
at async afterRead (file:///home/alien/sites/rwarri.org/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]__@[email protected][email protected][email protected]/node_modules/payload/dist/fields/hooks/afterRead/index.js:41:5)
Node.js v22.1.0
from payload.
Fixed in 7c8857a
(#6885).
Please re-open if this issue still appears in the upcoming 3.0.0-beta.54 release
from payload.
I have a related problem i think, my extra fields aren't showing up at all:
edit-fields-missing.mov
My RichText Field Config:
import { type RichTextField } from "payload"
import { FeatureProviderServer, UploadFeature, lexicalEditor } from "@payloadcms/richtext-lexical"
import link from "../link"
import { defaultFeatures } from "./defaultFeatures"
import deepMerge from "@/payload/utilities/deepMerge"
type RichText = (
overrides?: Partial<RichTextField>,
additions?: {
features?: FeatureProviderServer[]
}
) => RichTextField
const richText: RichText = (
overrides,
additions = {
features: [],
}
) =>
deepMerge<RichTextField, Partial<RichTextField>>(
{
name: "richText",
editor: lexicalEditor({
features: () => [
...[...defaultFeatures, ...(additions.features || [])],
UploadFeature({
collections: {
media: {
hasExtraFields: true,
fields: [
{
name: "caption",
editor: lexicalEditor({
features: () => [...defaultFeatures],
}),
label: "Caption",
type: "richText",
},
{
name: "alignment",
label: "Alignment",
options: [
{
label: "Left",
value: "left",
},
{
label: "Center",
value: "center",
},
{
label: "Right",
value: "right",
},
],
type: "radio",
},
{
name: "enableLink",
label: "Enable Link",
type: "checkbox",
},
/* link({
appearances: false,
disableLabel: true,
overrides: {
admin: {
condition: (_: any, data: any) => Boolean(data?.enableLink),
},
},
}), */
],
},
},
}),
],
}),
required: true,
type: "richText",
},
overrides || {}
)
export default richText
I am using all payload packages at Version 3.0.0-beta.60.
I would expect to see my extra fields: Caption (Richtext), Alignment (radio), enableLink (checkbox)
from payload.
Related Issues (20)
- Preview broken for localization EN when creating from FR with Postgres HOT 1
- Cannot publish a single locale and keep other locales in draft HOT 1
- Lots of inlined Scripts for Lexical and other component contexts causing inflated Admin Panel Size HOT 11
- Toast shows generic message from list view in admin panel
- Several inlined translations from unused locals HOT 1
- ⨯ Failed to download `Merriweather` from Google Fonts. Using fallback font instead HOT 1
- SEO + Tenancy + Global + Postgres does not seem to save/update
- Changing the cookie prefix prevents login in Next.js standalone mode
- Build production Error HOT 2
- Safari, @payloadcms/richtext-lexical, Invalid regular expression: invalid group specifier name HOT 4
- Move segments to root instead of /admin HOT 1
- Collection throws ValidationError when using slug `pages` HOT 1
- Locale overwriting (critical bug) HOT 1
- Serverless & db connections on vercel HOT 1
- Next dev & mongo adapter HOT 2
- DefaultTemplate not rendering any menu items in sidebar HOT 1
- Payload breaks with custom Babel config
- Payload Local API increase First Load JS size to client chunks HOT 1
- Form state doesn't update after Locale change HOT 1
- [v3] Need example of custom form in admin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from payload.