Comments (7)
any update on fixing this. it has reappeared again
from field-editors.
I am having the same issue. I am using the field like this.
const contentfulField = sdk.entry.fields[field.id].getForLocale(locale);
...
<RichTextEditor sdk={{ ...sdk, field: contentfulField }} />
from field-editors.
I have the same issue here: the rich text editor does not show the data coming from Contentful
, and when i try to enter any thing in the rich text editor i have the error TypeError: Cannot use 'in' operator to search for 'type' in document
.
I tried to take a look at the source code, and found out that the two issues comes from the way in which the @contentful/contentful-slatejs-adapter
package is working; as it is the one that is used to translate the rich text content between Contentful
and Slatejs
.
The issue is that in the function toContentfulDocument
we iterate over the fields in the document
object, which contains the field type
that has the value document
:
{
"type": "document"
}
then the function isSlateElement
is called with type
field as an argument:
function isSlateElement(node) {
return 'type' in node;
}
Which causes the error; as in
can not be used on a string value like this:
return 'type' in 'document'
I tried to play with the implementation to see if i can fix the issue, and managed to make the error disappear by changing the implementation of the function toContentfulDocument
to be:
....
flatmap(document.nodes, ...
...
Notice that my change is only using document.nodes
as an argument to flatmap
function instead od document
.
That made the error disappear, but it does not save the correct value in Contentful
's entry.
I am not sure if what i have done is useful or not, but i surely hope to get this issue fixed soon :)
from field-editors.
Hi all
Thanks for bringing this to our attention. I believe this is due to an update in our rich text to slate format adapter library that was shipped recently. I'll make a task for our team to fix this library's version to the previous v14.1.2. Apologies for the disruption caused in the meantime.
Chris
from field-editors.
It seems the fix is pushed but on npm it's still the last version (0.8.13), when is 0.8.14 dropping?
from field-editors.
@ayobami303 @sssgordon Apologies - looks like this was published with the wrong dist/
. Would you please try with v0.18.12
and report back if there are any issues?
from field-editors.
@cribbles Thanks for the response, it seems rolling back to 0.8.12
for @contentful/field-editor-rich-text does the trick as in I can use the rich-text field and save it no problem!
from field-editors.
Related Issues (20)
- RichTextEditor value and onChange props HOT 9
- Inline language tagging in rich text HOT 1
- Update lerna to latest HOT 2
- Is it possible to use Contentful Rich Text Editor separately HOT 3
- Option to completely disable Richtext Commands dialogue box from 'field-editor-rich-text' HOT 1
- Issue with react-sortable-hoc and React 18 HOT 3
- Rich Text Commands ignores linkContentType restriction HOT 1
- Markdown editor losing focus randomly while typing HOT 10
- Rich-Text-App Start "isValidImage" error HOT 2
- How to display a custom app within an entrty? Widgetnamespace = 'app' HOT 5
- This package is not working in Next.js project HOT 3
- Json field error HOT 2
- Entry is missing or inaccessible HOT 1
- Default field editors do not look like the latest Contentful UI HOT 4
- Attempted import error: 'File' is not exported from './typesEntity'. HOT 1
- Struggeling to use local version of @contentful/field-editor-single-line HOT 1
- SlugEditor: Allow option to make SlugEditor not track any title fields HOT 1
- Rich Text: Formatting options do not respect line breaks HOT 3
- `@contentful/field-editor-rich-text` depends on `constate` without specifying it in `package.json` HOT 1
- `@contentful/field-editor-rich-text` adds newlines after ordered / unordered lists HOT 1
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 field-editors.