Skip to content

text state feature reading state from undefined props #12518

Closed
@wellitongervickas

Description

@wellitongervickas

Describe the Bug


[TypeError: Cannot read properties of undefined (reading 'state')] {
 digest: '1143211231'
}

node_modules/@payloadcms/richtext-lexical/dist/features/textState/feature.server.js:19
       state: props.state
^


TypeError: Cannot read properties of undefined (reading 'state')

in order to fix that locally, I push directly to the code (just to test):

export const TextStateFeature = createServerFeature({
  feature: ({
    props
  }) => {
    return {
      ClientFeature: '@payloadcms/richtext-lexical/client#TextStateFeatureClient',
      clientFeatureProps: {
        // state: props.state
        state: props?.state
      }
    };
  },
  key: 'textState'
});
//# sourceMappingURL=feature.server.js.map

now its working.

Link to the code that reproduces this issue

https://github.com/payloadcms/payload/blob/main/packages/richtext-lexical/src/features/textState/feature.server.ts#L72

Reproduction Steps

  1. install latest version (3.39.1)
  2. import feature text state
  3. run payload
  4. then it crases

Which area(s) are affected? (Select all that apply)

plugin: richtext-lexical

Environment Info

payload v3.39.1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions