Out of nowhere, recently over the weekend, we began receiving reports from our clients that issues suddenly appeared on their Magento 2 sites. What’s more, no updates were made on the store-owner side. Multiple emails were received describing identical issues, so our team took the situation seriously.
Being on guard, we always work hard to figure out what’s happening. Good news, we managed to identify the real cause. This post requires prompt attention. Continue to read.
How does it typically appear?
Usually, a JS error looks like this:
Uncaught SyntaxError: JSON.parse: end of data while reading object contents at line 1 column 2 of the JSON data
After the investigation, we noticed that the widget attributes had changed from
data-mage-init='{"component":{}'
To
data-mage-init='{"component":{}'
So, we discovered that this issue mostly occurs on servers running cPanel. In particular, cPanel has pushed new builds of PHP 8.2 and 8.3 bundled with libxml version 2.15.1.
More interesting is the fact that this issue happens for all widgets that have data-mage-init in an HTML type element in the Magento 2 Page builder. Consequently, Page Builder content may fail to load or render correctly. Note that this problem appears even without any change in the Magento 2 codebase, which makes it confusing for store owners.
The HTML code got broken and looks like this
data-mage-init='{"component":{}'>
Based on our investigation, this issue affects all modules and widgets that try to output the data-mage-init attribute within the HTML element of Magento 2 Pagebuilder.
What to do?
#1 If you have full control over your server build, you can temporarily revert to the previous version of the libxml library.
#2 However, many hosting environments do not allow downgrading system libraries. We have a solution. We prepared a new version of our core module, swissu/module-core 1.12.25. This updated release includes a fix that replaces double quotes with single quotes in the affected widget output. Moreover, it corrects issues caused by the new version of the libxml library and ensures Magento 2 Page Builder continues to function smoothly.
Thus, all you need to do is update our core module. Do not put it off for a week. As an owner, you should keep your e-commerce store stable despite server-side changes and protect your clients from unexpected downtime.
Please note that some of our customers also reported a broken HTML markup issue, probably linked to our swissup/module-seo-cross-links module. Please disable it if you notice that the entire HTML markup is broken. We are still investigating that issue.
To sum up, we appreciate your trust, and as always, we are ready to act quickly so your e-commerce stores can move forward.