plonegovbr / volto-code-block

Volto add-on providing a code block with syntax highlighting.
2 stars 3 forks source link

volto-code-block 2.2.1 crashes on start: TypeError: block.allowedBlocks is not iterable #22

Closed kenmanheimer closed 7 months ago

kenmanheimer commented 7 months ago

Synopsis

When trying to yarn start a new build of my Volto frontend with the most recent volto-code-block release I get the fatal error indicated in the subject line. I'm including a traceback below. When I use the same build except I've done a yarn add @plonegovbr/volto-code-block@2.1.0 (the less recent version I used in my prior build) the frontend works fine.

Below is the full traceback from yarn start with volto-code-block 2.2.1, and below that is a full dependencies block from my project package.json, in case the other dependencies make a difference.

Traceback

/bulk/klm/Servers/Myr/myriadicity-net-2024-03-27/frontend/build/webpack:/frontend/node_modules/@plonegovbr/volto-code-block/src/index.js:102
  ['gridBlock', 'accordion'].forEach((blockId) => {
^
TypeError: block.allowedBlocks is not iterable
    at /bulk/klm/Servers/Myr/myriadicity-net-2024-03-27/frontend/frontend/node_modules/@plonegovbr/volto-code-block/src/index.js:105:1
    at Array.forEach (<anonymous>)
    at applyConfig (/bulk/klm/Servers/Myr/myriadicity-net-2024-03-27/frontend/build/webpack:/frontend/node_modules/@plonegovbr/volto-code-block/src/index.js:102:1)
    at /bulk/klm/Servers/Myr/myriadicity-net-2024-03-27/frontend/build/webpack:/frontend/tmp/tmp-1962298-Znj77xxI8xlq-.js:65:1
    at /bulk/klm/Servers/Myr/myriadicity-net-2024-03-27/frontend/build/webpack:/frontend/tmp/tmp-1962298-Znj77xxI8xlq-.js:83:1
    at Array.reduce (<anonymous>)
    at load (/bulk/klm/Servers/Myr/myriadicity-net-2024-03-27/frontend/build/webpack:/frontend/tmp/tmp-1962298-Znj77xxI8xlq-.js:83:1)
    at Module../node_modules/@plone/volto/src/config/index.js (/bulk/klm/Servers/Myr/myriadicity-net-2024-03-27/frontend/build/webpack:/frontend/node_modules/@plone/volto/src/config/index.js:258:1)
    at __webpack_require__ (/bulk/klm/Servers/Myr/myriadicity-net-2024-03-27/frontend/build/webpack:/frontend/webpack/bootstrap:24:1)
    at fn (/bulk/klm/Servers/Myr/myriadicity-net-2024-03-27/frontend/build/webpack:/frontend/webpack/runtime/hot module replacement:62:1)
sswp> !!! Script exited with code 1

package.json dependencies block:

  "dependencies": {
    "@adeweb-be/volto-leaflet-block": "0.2.0",
    "@eeacms/volto-banner": "3.1.5",
    "@eeacms/volto-eea-kitkat": "23.0.1",
    "@eeacms/volto-embed": "9.1.1",
    "@eeacms/volto-pdf-block": "1.0.11",
    "@kitconcept/volto-button-block": "2.3.1",
    "@kitconcept/volto-carousel-block": "1.1.0",
    "@kitconcept/volto-dsgvo-banner": "2.3.2",
    "@kitconcept/volto-heading-block": "2.4.0",
    "@kitconcept/volto-slider-block": "6.3.1",
    "@plone/volto": "17.15.5",
    "@plonegovbr/volto-code-block": "2.2.1",
    "volto-google-analytics": "2.1.0"
  },
ericof commented 7 months ago

Fixed by #20

ericof commented 7 months ago

@kenmanheimer, the 2.2.2 release should fix the issue.

kenmanheimer commented 7 months ago

Thanks, 2.2.2 works.