Clicking "Add block" in rich-text editor throws js error in browser causing preview to disapear

We use Storyblok with Gatsby.js and our content editors have reported that some editing actions such as using “Add block” to add a link in rich text editor causes preview panel to become white (all content disappears). When I use Chrome developer console I see following js errors thrown when “Add block” is clicked.

framework-680421a….js:2 TypeError: Cannot read property 'replace' of undefined
    at Object.roche-text-link (VM14 037a33d7d91242979e1693ec9ed2636c7a63d679-11f19498868ef3a0b51b.js:1)
    at VM14 037a33d7d91242979e1693ec9ed2636c7a63d679-11f19498868ef3a0b51b.js:1
    at VM14 037a33d7d91242979e1693ec9ed2636c7a63d679-11f19498868ef3a0b51b.js:1
    at Array.forEach (<anonymous>)
    at Object.blok (VM14 037a33d7d91242979e1693ec9ed2636c7a63d679-11f19498868ef3a0b51b.js:1)
    at t.value (VM14 037a33d7d91242979e1693ec9ed2636c7a63d679-11f19498868ef3a0b51b.js:1)
    at t.value (VM14 037a33d7d91242979e1693ec9ed2636c7a63d679-11f19498868ef3a0b51b.js:1)
    at VM14 037a33d7d91242979e1693ec9ed2636c7a63d679-11f19498868ef3a0b51b.js:1
    at Array.forEach (<anonymous>)
    at t.value (VM14 037a33d7d91242979e1693ec9ed2636c7a63d679-11f19498868ef3a0b51b.js:1)

In markup inside editor’s preview iframe the content inside div <div id="___gatsby"></div> is gone too. Any idea what can be causing this?