How to find the problem block?
# help-with-umbraco
m
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
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.
*Source Link
m
problem is I have no custom code attached to publishing :S
Got source link working but not sure how to "catch" the error 😦
so looks like I have an array followed by nulls somewhere :S
d
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
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 😄
72 Views