Skip to content

Magento 2.3.4 – Swatch Renderer assumes all attributes are swatches

See line 726 of the new swatch-renderer.js file for Magento 2.3.4 here.

The jsonSwatchConfig JSON object only includes data for swatch-type attributes. (See MagentoSwatchesHelperData::getSwatchAttributes.) However, the above line in the latest version of swatch-renderer.js assumes that all attributes it encounters _onClick will exist in this JSON.

This results in the following error when clicking non-swatch attributes:

Uncaught TypeError: Cannot read property 'additional_data' of undefined

It is possible to mix swatch and non-swatch attributes in a Configurable product. Is this a new core bug in 2.3.4?