• “Block encounters an error” when using a couple different accordion plugins in wordpress.

    When using Easy Accordion Gutenberg Block, I get this react.js error:

    Error: Switching useSelect from mapping to mapping is not allowed
    at Be (data.min.js?ver=90cebfec01d1a3f0368e:9:2849)
    at nd (block-editor.min.js?ver=ed2b2aa3837336baf00f:26:202475)
    at edit (index.js?ver=31e933e4680bb50876f0:33:18752)
    at kt (react-dom.min.js?ver=18.2.0:10:47633)
    at gr (react-dom.min.js?ver=18.2.0:10:56448)
    at js (react-dom.min.js?ver=18.2.0:10:121615)
    at kl (react-dom.min.js?ver=18.2.0:10:88654)
    at yl (react-dom.min.js?ver=18.2.0:10:88582)
    at vl (react-dom.min.js?ver=18.2.0:10:88445)
    at ol (react-dom.min.js?ver=18.2.0:10:85269)

    When using Lightweight Accordion I get the following react.js error:

    react-dom.min.js?ver=18.2.0:10 Error: Minified React error #300; visit https://reactjs.org/docs/error-decoder.html?invariant=300 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at kt (react-dom.min.js?ver=18.2.0:10:47837)
    at gr (react-dom.min.js?ver=18.2.0:10:56448)
    at js (react-dom.min.js?ver=18.2.0:10:121615)
    at kl (react-dom.min.js?ver=18.2.0:10:88654)
    at yl (react-dom.min.js?ver=18.2.0:10:88582)
    at vl (react-dom.min.js?ver=18.2.0:10:88445)
    at ol (react-dom.min.js?ver=18.2.0:10:85269)
    at cl (react-dom.min.js?ver=18.2.0:10:85656)
    at zn (react-dom.min.js?ver=18.2.0:10:32470)
    at react-dom.min.js?ver=18.2.0:10:83221

    https://legacy.reactjs.org/docs/error-decoder.html/?invariant=300

    Let me know if I can provide any additional information.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Munir Kamal

    (@munirkamal)

    I have identified the conflicting feature as the “Custom Class Names”.

    However, I am still unable to pinpoint what is causing the conflict with the Easy Accordion Block plugin. This feature has worked well in most cases, but it has caused conflicts with two plugins so far.

    I suggest informing their support team of this issue and providing them with the code reference for this feature from Editor’s Kit. You can find the code reference here:

    https://github.com/CakeWP/block-options/blob/master/src/extensions/advanced-controls/custom-class-name/index.js

    I believe this has something for them, but you can disable the mentioned feature if you don’t use it and want to use both plugins.

    Hope this helps.

    Hi @munirkamal.

    Thank you for the EditorsKit plugin. I am one of the authors of the Tainacan plugin and I too have identified this conflict with some of ours blocks. Basically, every time I call a useSelect inside a block, it triggers the error if the custom class names feature is enabled.

    I also don’t understand the cause for this. I’ll just give you some links here that I believe may be useful if you want to investigate on your side:

    This is the where the error message comes from in the Gutenberg source code:

    https://github.com/WordPress/gutenberg/blob/7b334ff38ade601c41a49e4bba8034501c6b0926/packages/data/src/components/use-select/index.js#L264

    Notice how it mentions this “static” vs “mapping” context change. I believe it may be related to different moments when the hook can be called. This StackOveflow topic made me believe it can be caused by invoking it multiple times in the same context, but I’m not familiar with hooks.

    Looking into the EditorsKit plugin source code, the only curious thing that I can notice is that you are using withSelect instead of useSelect, which was introduced a few years ago and seems the be the more “canonical” approach according to the Gutenberg Documentation.

    Hope this helps somehow finding a solution!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conflict with Accordion Plugins’ is closed to new replies.