Closed FreakeyPlays closed 2 months ago
Hi @FreakeyPlays.
Unfortunately, shortly after that video was uploaded, there was a change in the way things are imported.
Before you could directly import things from the client to the server. Now you need to import the path.
The PR where this happened is https://github.com/payloadcms/payload/pull/7620
In particular, you might want to look at the documentation file which explains how to import correctly:
Or alternatively look at how the current features are made in the repository (inside the packages/richtext-lexical/features
).
Sorry for the confusion! Hopefully this will be much clearer on the website in the upcoming release!
Please let me know if this answers your question or if there is anything else I can help you with.
I'm closing this issue. If you're still having trouble with this, feel free to ask on Discord.
This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.
Link to reproduction
No response
Environment Info
Describe the Bug
I wanted to create a feature for the lexical editor. I followed the Docs and the offical video. My server feature complained about the wrong types.
The
createServerFunction({}).feature.ClientFeature
needs:PayloadComponent<never, { featureKey: string; order: number; }> | undefined
The type
createClientFeature
returned:FC<{featureKey: string, order: number}>
As I crawled through the compiled files at
@payloadcms/richtext-lexica
l I found that the shipped features (Bold-, Italic Feature etc.) used the createClientFeature from theutilities
folder. Since I can't import that function, I thought I would post this issue here because maby the wrong function got exported.Reproduction Steps
Create a minimal custom Feature for the Lexical Editor.
myFeature/feature.client.ts
myFeature/feature.server.ts
There is no need to import it anywhere, since the IDE should show the error that the type does not match.
Adapters and Plugins
No response