I was experiencing the same issue like while, inserting new view rendering on the page, error was same as mentioned above of Uncaught TypeError: Cannot read the property 'substr' of undefined.
I found one solution and it worked totally for me and that is while you are on edit mode, change your slick property of 'infinite' to false(as by default the value is set to true) and boom there we go with normal flow as before.
Hope it works for you too :)