blocknote.map is not a function
Hello team,
Have a new issue that started happening either in the front when accessing companies or notes, was able to reproduce it in the backend when calling the /notes endpoint :

14 Replies
For context, I have created a script to automatically create notes and used the blocknote JS format (wanted to use markdown but when creating notes with the notes V2 with only Markdown, appaeared as blank in the frontend), I wonder if something went wrong there, or maybe in the note targets π€ Let me know how I can provide more info to figure this out
Issue happened on v.0.50.0, updated to v.0.50.1 but still happens


@Prastoin found this https://www.answeroverflow.com/m/1341137711481884673 from 2 months ago, maybe it's the same issue ?
`useFindManyRecords for "notes" error : ApolloError: blocknote.map ...
I get a the error
blocknote.map is not a function
when loading the notes page. Console log shows the following error: useFindManyRecords for "notes" error : ApolloError: blocknote.map is not a function
any ideas?Hey @dasco ! Have you been hitting the api directly to insert notes lately ?
Indeed
If yes seems like you have null values that should be defaulted to either empty object or empty array
used the V2 -> Blocknote part of the API
Would double check by creating an empty note using the UI or check others rows
ATM on holidays and mobile but would love if you could open a GitHub issue about the fact that api is not validating data correctly
Will try as soon as my meetings end, but don't know how I can see them because of the 404 error on the backend, but will def do the github issue π
To fix your issue you should be able to make any null value to empty array ( I think to double check ) using psql or whatever db explorer
maybe directly on the postgre db
hahaha exactly, ok will update this thread with what I find π
Sounds great ! Enjoy coding
TY enjoy your holidays !
As an update, I did remove recent rows from the db in Notes and it fixed it (sorry it was not an efficient fix and couldn't pinpoint the exact issue, I got frustrated :D)
No worries all good ! We should refactor the api to be stricter it should not allow data insertion that result in such error
Enjoy coding !