When saving and publishing (I have far too many content nodes to know which one, as its part of a migration)
Is there a way I can debug to find the source of this:
Error occurred executing workItem.
Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Umbraco.Cms.Core.Models.Blocks.BlockValue'
d
D_Inventor
08/14/2023, 2:38 PM
Oh man, I've been struggling with this exact issue a lot as well. Best way I've been able to debug it was to enable the source download thingy I can't remember the name so that you can step into package source code. Then I let the exception happen and when visual studio is in break mode, I click through the stack view in visual studio until I get into a piece of Umbraco Source code that reveals the exact block to me. It's still very painful, but the best way I've been able to do it.
D_Inventor
08/14/2023, 2:39 PM
*Source Link
m
Matt Wise
08/14/2023, 3:49 PM
problem is I have no custom code attached to publishing :S
Matt Wise
08/14/2023, 4:14 PM
Got source link working but not sure how to "catch" the error 😦
Matt Wise
08/14/2023, 4:44 PM
so looks like I have an array followed by nulls somewhere :S
d
D_Inventor
08/15/2023, 4:47 AM
I did it turning "Enable Just My Code" off and by turning "Enable Source Link support" on. The first one allows me to catch errors in library code. I would also recommend checking exception settings while debugging and enabling Common Language Runtime Exceptions with a check, otherwise you might be missing out on some exceptions.
m
Matt Wise
08/15/2023, 8:05 AM
Cheers mate, I found it eventually... an empty array followed by nulls, but no nulls in the debugger... and a publish fixed it... Only took me 2-3hrs as it was super deep into the indexing 😄