Notes are Throwing Errors: Cannot read properties of null (reading 'map')
I have been creating notes and their targets (companyId & opportunityId) via the REST API. Successfully too, as I have been getting this back:
[
{
"data": {
"createNote": {
"updatedAt": "2025-07-03T07:10:04.278Z",
"deletedAt": null,
"position": 0,
"title": "",
"body": null,
"bodyV2": {
"blocknote": "null",
"markdown": "abcdefg" ....
But when I go to the notes section, it doesn't show me anything and I get this error message: Cannot read properties of null (reading 'map').
Disclosure: I'm a somewhat tech-savvy business user, so I don't know what to do here :-). Any advice?
18 Replies
Mhmm sounds like server side validation issue
Could you please share the whole request so I can give this a try locally ?
Sure. Here are my two calls:
1) createNotes (/rest/notes)
`
2) createNoteTarget (/rest/noteTargets)
`
On it
Hey @BigKahuna from my understanding you need to pass a value to bodyV2.blocknote section
Such as with
You're getting map not defined because bodyV2.blockNote shouldn't be nullable
Seems to be a twenty-server lack of validation here
Regarding the targetNote unless I'm mistaken we've seen that together already ?
The markdown property seems to be computed by the server
text wdowidwoiudw/
So from my understanding we're expecting the caller to send a blocknote js data format 🤔 which mean we expect him to have the dep, that's not the smoothest thing
@Lucas do you have more information regarding that please ?
It seems strange that we expect a user to pass a blocknote JSON, @BigKahuna where do the data come from ? Is it an import from a previous Twenty export or does it come from another manually crafted file ?
It seems more relevant to pass either markdown either raw text, both should go to markdown property anyway
We may have to create a path for API and separate it from our current path for GraphQL
Hi, @Prastoin @Lucas. Thanks for looking into this. To answer the questions: I am exporting my Pipedrive notes here, which are kept in HTML and I am manually converting them to markdown for compatibility. Thus I am only inserting my markdown in bodyV2 and blocknote remains empty. And I can, in fact, create notes that way and fetch them via the API. I just get these Cannot read properties of null (reading 'map') errors when trying to view all people, companies or opportunities (of which some are linked to a note).
When I was exporting my tasks, on the other hand, I just inserted the task title in blocknote and that seemed to work well enough to not cause any errors. I'll try inserting a hard coded text to see if that helps with notes too.
Could you share a file with a line of anonymized data that matches the structure of what you send to the API ? It seems that what you shared is the return of the calls isn’t it ?
Sure (and you're right), here's an example of my call.
Create individual note:
Create note targets for all notes at once:
So what I just tried was to add the title-value to the blocknote-variable and suddenly: Things worked.
Well: Except for the fact that I can't see the markdown body of my notes that I was expecting :-(. Where did that go?

@Lucas @Prastoin I re-discovered this old ticket here: https://github.com/twentyhq/twenty/issues/10606
It describes EXACTLY the error I am seeing (now that I am providing a text for the blocknote variable).
I tried to add a blocknote text to the blocknote variable and suddenly I was getting a body text that was also visible in the UI.
But I'm a bit clueless on how to transform my markdown text to blocknote. Just making it the value of my blocknote variable does not magically convert it to blocktext (that would have been nice).
GitHub
Note body not visible when via API with bodyV2 without blocknote ·...
Bug Description Creating a note via API with bodyV2 and without a blocknote component will not allow the body component to be visible in the UI despite a successful API call. Inputting markdown tex...
I agree with you we have clearly transpilation improvements to make on server side validation/transformation steps
is the response bodyV2.markdown null here ?
No. blocknote is null, markdown has actual markdown text
We've created a bug ticket to finalize the blockNote v2 migration https://github.com/twentyhq/twenty/issues/13110, it will be assigned next monday at the start of the next sprint
We will take care to create integration test on both REST and graphQl API to assert it's working as expected
I think we can also improve the expected format to be more flexible either already parsed as blocknote format or raw markdown etc
this will be discussed
GitHub
twentyhq/twenty
Building a modern alternative to Salesforce, powered by the community. - twentyhq/twenty
Uhm, another quick question (since I just experimenting a little for the fun of it): Am I meant to be able to provide "updatedAt" with a certain value via the API? Because I actually can (that was unexpected). But, of course, that causes an error in the UI too.
How long are your sprints usually? Two weeks?
Yes, if we end up to fix it earlier I will publish a docker image in the hub for you
I don't think that's intented, creating a bug thanks
What would be annoying is if you can set the
deletedAt
🤔
Will create TDD integrations tests and open an issue with related information depending on the situation, tomorrow morningThat would be grand. I just checked: Two weeks is just 1 day shy of our next pipedrive billing cycle on the 26th 😂
Will try to find a workaround way before so you can plan things easily
Blocking tomorrow morning for support anw
So I've investigated the issue it seems like that blocknote transpilation from raw markdown to blocks is lossy
Could you please send me a raw markdown you're having issue with ? On my side was only able to reproduce partial rendering but never none
I have a few examples, but there is nothing special about them really. E.g.:
"In xxx bei virtualitee Messe kennegelernt / yyy in Paris"
Or: "xxx ist ein yyy aus Paris. \n\nSie haben bereits zzz etc. lizensiert.\n\nDer Account passt nicht in unser ICP."
Hi, Prastoin. Is there any update on this issue?
Hey @Félix, sorry for the dispatch but would please mind having a look to this when you have some free time ? Unfortunately I don't have time to re-check
In a nutshell Kahuna when hitting the api to insert blockNote, sometimes result in nothing displayed in the notes within the client
As we've been talking about in DM I've indeed been able to reproduce a lossy migration from markdown to block but never a complete loss resulting in nothing displayed in the UI