• This is driving me crazy is because it happens in the live site – yet if I pull that to a staging site as a sub directory on the same host it works fine.

    That is OK – except – when I push ( files & database back to live ) the problem persists. Been through cache clearing etc etc in fact I do that when I push to live automatically.

    On live, using the troubleshooting plugin I have narrowed it down to two plugins – the one that uses the Block editor and another. At this stage my main concern is why can’t I replicate the issue on staging – rather than the particular plugin conflicts. ( neither are mine )

    The block editor gives me error info but it means nothing to me

    WP 5.9.2

    TypeError: Cannot read properties of undefined (reading 'indexOf')
        at n (https://xxxxxx/wp-includes/js/dist/editor.min.js?ver=8d4a298f55ea5a97c9e5147f9e132d82:7:111005)
        at https://xxxxxx/wp-includes/js/dist/editor.min.js?ver=8d4a298f55ea5a97c9e5147f9e132d82:7:111120
        at Array.sort (<anonymous>)
        at https://xxxxxx/wp-includes/js/dist/editor.min.js?ver=8d4a298f55ea5a97c9e5147f9e132d82:7:111099
        at https://xxxxxx/wp-includes/js/dist/editor.min.js?ver=8d4a298f55ea5a97c9e5147f9e132d82:7:111170
        at Object.wh [as useMemo] (https://xxxxx/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:109:150)
        at c.useMemo (https://xxxxx/wp-includes/js/dist/vendor/react.min.js?ver=17.0.1:30:236)
        at https://xxxxxx/wp-includes/js/dist/editor.min.js?ver=8d4a298f55ea5a97c9e5147f9e132d82:7:110968
        at Le (https://xxxxxx/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:100:3)
        at Re (https://xxxxxx/wp-includes/js/dist/vendor/react-dom.min.js?ver=17.0.1:113:271)

    Any clues as what to look for gratefully received

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Alan Fuller

    (@alanfuller)

    Ah now I know what Script debug is for

    function sortBySelected(termsTree, terms) {
      const treeHasSelection = termTree => {
        if (terms.indexOf(termTree.id) !== -1) {
          return true;
        }

    Editor.js doesn’t check for the existence of terms before applying a method, should be something like the following

    function sortBySelected(termsTree, terms) {
      const treeHasSelection = termTree => {
       if ( terms ) {
        if (terms.indexOf(termTree.id) !== -1) {
          return true;
        }
    }

    I guess I will have to put that in gutenberg issues log

    Thread Starter Alan Fuller

    (@alanfuller)

    It seems that it doesn’t happen in the development Gutenberg plugin so I guess it has been fixed.

    But really I don’t understand why it happens in one environment but not it’s clone.

    Check the response coming from this call getEditedPostAttribute( _taxonomy.rest_base )

    Thread Starter Alan Fuller

    (@alanfuller)

    in call
    editor.js?ver=8d4a298f55ea5a97c9e5147f9e132d82:9813 Uncaught ReferenceError: getEditedPostAttribute is not defined
        at sortBySelected (editor.js?ver=8d4a298f55ea5a97c9e5147f9e132d82:9813:11)
        at editor.js?ver=8d4a298f55ea5a97c9e5147f9e132d82:9957:76
        at mountMemo (react-dom.js?ver=17.0.1:15876:21)
        at Object.useMemo (react-dom.js?ver=17.0.1:16249:18)
        at useMemo (react.js?ver=17.0.1:1557:23)
        at HierarchicalTermSelector (editor.js?ver=8d4a298f55ea5a97c9e5147f9e132d82:9957:69)
        at renderWithHooks (react-dom.js?ver=17.0.1:15015:20)
        at mountIndeterminateComponent (react-dom.js?ver=17.0.1:17841:15)
        at beginWork (react-dom.js?ver=17.0.1:19079:18)
        at HTMLUnknownElement.callCallback (react-dom.js?ver=17.0.1:3942:16)
    Thread Starter Alan Fuller

    (@alanfuller)

    2022-03-17-22-18

    • This reply was modified 2 years, 7 months ago by Alan Fuller.

    Can you log for which taxonomy it’s getting undefined and what is rest_base that’s being passed as attributeName for that taxonomy?

    Thread Starter Alan Fuller

    (@alanfuller)

    I guess i could, but there are two things
    1. when I install Gutenberg plugin the issue is gone
    2. when i run it on staging the issue is gone – this second fact worried more than the issue itself

    Try this, create back of editor.js and copy the editor.js then see, what happens.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Block editor crashes’ is closed to new replies.