EnlighterJS/Plugin.Gutenberg

Gutenberg: Empty block causes fatal javascript error

emaillenin opened this issue · 1 comments

Plugin version: Version 4.4.1
Wordpress version: Version 5.6
When opening the edit post page, the following error is shown on the Console. This results in a blank page.

Uncaught (in promise) TypeError: e is undefined
    f https://c0.wp.com/c/5.6/wp-includes/js/dist/escape-html.min.js:2
    save https://jiga.dev/wp-content/plugins/enlighter/resources/gutenberg/enlighterjs.gutenberg.min.js?ver=4.4.1:2
    Qt https://c0.wp.com/c/5.6/wp-includes/js/dist/blocks.min.js:3
    Xt https://c0.wp.com/c/5.6/wp-includes/js/dist/blocks.min.js:3
    blockEditor https://c0.wp.com/c/5.6/wp-includes/js/dist/block-editor.min.js:12
    a https://c0.wp.com/c/5.6/wp-includes/js/dist/hooks.min.js:2
    qr https://c0.wp.com/c/5.6/wp-includes/js/dist/blocks.min.js:3
    Gr https://c0.wp.com/c/5.6/wp-includes/js/dist/blocks.min.js:3
    Yr https://c0.wp.com/c/5.6/wp-includes/js/dist/blocks.min.js:3
    Yr https://c0.wp.com/c/5.6/wp-includes/js/dist/blocks.min.js:3
    hn https://c0.wp.com/c/5.6/wp-includes/js/dist/editor.min.js:7
    tryCatch https://c0.wp.com/c/5.6/wp-includes/js/dist/vendor/wp-polyfill.min.js:1
    invoke https://c0.wp.com/c/5.6/wp-includes/js/dist/vendor/wp-polyfill.min.js:1
    n https://c0.wp.com/c/5.6/wp-includes/js/dist/vendor/wp-polyfill.min.js:1
    Redux 6
    V https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    F https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    p https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    Be https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    n https://c0.wp.com/c/5.6/wp-includes/js/dist/editor.min.js:7
    React 13
    e https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    t https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    o https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    o https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    O https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    p https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    s Redux
    V https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    F https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    dispatch https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    Redux 48
    V https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
escape-html.min.js:2:1674
    Redux 6
    V https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    F https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    p https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    Be https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    n https://c0.wp.com/c/5.6/wp-includes/js/dist/editor.min.js:7
    React 6
    Te self-hosted:1208
    React 7
    ch self-hosted:1265
    e https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    t https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    o https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    forEach self-hosted:206
    o https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    O https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    p https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    s Redux
    V https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    F https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    dispatch https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2
    Redux 2
    some self-hosted:165
    Redux 4
    some self-hosted:165
    Redux 4
    some self-hosted:165
    Redux 4
    some self-hosted:165
    Redux 3
    some self-hosted:165
    Redux 4
    some self-hosted:165
    Redux 4
    some self-hosted:165
    Redux 6
    some self-hosted:165
    Redux 4
    some self-hosted:165
    Redux 6
    some self-hosted:165
    Redux 7
    V https://c0.wp.com/c/5.6/wp-includes/js/dist/data.min.js:2

Hi @emaillenin ,

we've had a similar issue some month ago. it seems like it's caused by an empty codeblock where the editor returns "null" and the escape function fails.

just try to re-create the post without empty blocks. i'll investigate the issue and provide a fix asap