---
title: "Magento 2.3.XX unable to serialize value and Failed to load the components errors on checkout"
url: "https://dolphinwebsolution.com/magento-2-3-xx-unable-to-serialize-value"
date: "2020-10-28T04:20:50+05:30"
modified: "2025-07-24T11:44:58+05:30"
author:
  name: "Jigar Patel"
categories:
  - "Magento"
word_count: 439
reading_time: "3 min read"
summary: "CRITICAL Error: Unable to serialize value
When I upgraded the Magento on the checkout page and that was \"report.CRITICAL: Unable to serialize value. Error: Malformed UTF-8 characters, possible inc..."
description: "Failed to load the components errors on checkout/cart page after upgrading Magento and Magento 2.3.XX unable to serialize value. error: malformed utf-8 chara..."
keywords: "unable to serialize value,serialize,checkout,utf-8,fail to load components, Magento"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How Much Does Magento Development Cost in 2026?"
    url: "https://dolphinwebsolution.com/blog/magento-development-cost/"
  - title: "How To Programmatically Export Category Name With Parent Category Name Magento 2"
    url: "https://dolphinwebsolution.com/how-to-programmatically-export-category-name-with-parent-category-name-magento-2"
  - title: "Top 10 Magento Development Companies in USA"
    url: "https://dolphinwebsolution.com/blog/top-magento-development-companies-in-usa/"
---

# Magento 2.3.XX unable to serialize value and Failed to load the components errors on checkout

_Published: October 28, 2020_  
_Author: Jigar Patel_  

![](https://dolphinwebsolution.com/wp-content/uploads/2023/02/errors-on-checkout-1024x512.jpg)

#### *CRITICAL Error: Unable to serialize value*

When I upgraded the Magento on the checkout page and that was *“report.CRITICAL: Unable to serialize value. Error: Malformed UTF-8 characters, possible incorrectly encoded.”*

### **Please follow below step**:

1\) Create registration.php file at Path :- app/code/Dolphin/Serializer

```
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Dolphin_Serializer',
    __DIR__
);
```

2\) Create module.xml file at Path :- app/code/Dolphin/Serializer/etc

```
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Dolphin_Serializer" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Framework"/>
        </sequence>
    </module>
</config>
```

3\) Create di.xml file at path :- app/code/Dolphin/Serializer/etc

```
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Framework\Serialize\Serializer\Json" type="Dolphin\Serializer\Rewrite\Magento\Framework\Serialize\Serializer\Json"/>
    <preference for="Magento\Framework\Serialize\Serializer\JsonHexTag" type="Dolphin\Serializer\Rewrite\Magento\Framework\Serialize\Serializer\JsonHexTag"/>
</config>
```

4\) Create Json.php file at path :- app/code/Dolphin/Serializer/Rewrite/Magento/Framework/Serialize/Serializer

```
<?php

namespace Dolphin\Serializer\Rewrite\Magento\Framework\Serialize\Serializer;

class Json extends \Magento\Framework\Serialize\Serializer\Json
{
    public function utf8ize($mixed)
    {
        if (is_array($mixed)) {
            foreach ($mixed as $key => $value) {
                $mixed[$key] = $this->utf8ize($value);
            }
        } elseif (is_string($mixed)) {
            return mb_convert_encoding($mixed, "UTF-8", "UTF-8");
        }

        return $mixed;
    }
    /**
     * @inheritDoc
     * @since 101.0.0
     */
    public function serialize($data)
    {
        $result = json_encode($this->utf8ize($data));
        if (false === $result) {
            throw new \InvalidArgumentException("Unable to serialize value. Error: " . json_last_error_msg());
        }
        return $result;
    }

    /**
     * @inheritDoc
     * @since 101.0.0
     */
    public function unserialize($string)
    {
        $result = json_decode($string, true);
        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new \InvalidArgumentException("Unable to unserialize value. Error: " . json_last_error_msg());
        }
        return $result;
    }
}
```

5\) Create JsonHexTag.php file at path :- app/code/Dolphin/Serializer/Rewrite/Magento/Framework/Serialize/Serializer

```
<?php

namespace Dolphin\Serializer\Rewrite\Magento\Framework\Serialize\Serializer;

class JsonHexTag extends \Magento\Framework\Serialize\Serializer\JsonHexTag
{
    /**
     * @inheritDoc
     * @since 102.0.1
     */
    public function serialize($data): string
    {
        $data = $this->utf8convert($data);
        $result = json_encode($data, JSON_HEX_TAG);
        if (false === $result) {
            throw new \InvalidArgumentException('Unable to serialize value.');
        }
        return $result;
    }

    public function utf8convert($mixed, $key = null)
    {
        if (is_array($mixed)) {
            foreach ($mixed as $key => $value) {
                $mixed[$key] = $this->utf8convert($value, $key);
            }
        } elseif (is_string($mixed)) {
            $fixed = mb_convert_encoding($mixed, "UTF-8", "UTF-8");
            return $fixed;
        }
        return $mixed;
    }
}
```

Hope this helps. Thanks.


---

_View the original post at: [https://dolphinwebsolution.com/magento-2-3-xx-unable-to-serialize-value](https://dolphinwebsolution.com/magento-2-3-xx-unable-to-serialize-value)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-26 06:14:12 UTC_  
