1

Type Error occurred when creating object: Magento\Framework\Locale\Resolver

when I run this command this error shows. I am using third party theme.

Already tried deleting generated and var/di enter image description here

  • check your system.log from var/log/system.log. Here you can find the issue – Teja Bhagavan Kollepara Jun 13 at 10:30
  • Deleting var/generation, var/cache and var/di and try – Rk Rathod Jun 13 at 10:33
  • already done deleting now it stop even showing any error – Asad Ullah Jun 13 at 10:34
  • run php bin/magento setup:static-content:deploy -f now it will generate again – Teja Bhagavan Kollepara Jun 13 at 10:35
  • nothing no result – Asad Ullah Jun 13 at 10:37
6

The fix for the issue -

Type Error occurred when creating object: Magento\Framework\Locale\Resolver

is not modifying the core class at all. We need to understand the cause of it first. Modifying the core class is not recommended at all. The issue is not with the class vendor/magento/framework/Encryption/Adapter/SodiumChachaIetf.php

But the issue with the crypt key added to your app/etc/env.php

The reason of this issue is the crypt key is mismatched. You must have taken the database dump from any other instance and trying to run with your current instance. So along with database you need to get the crypt key from the same setup where from you got the db dump.

Just update the crypt key in env.php and it will work fine.

The fix is to use same pair of crypt key of the installation from where db is being used.

Hope it is explained.

Mark me up if was helpful. Happy coding..!!

4

I have searched around and found this solution this is because of return $plainText SodiumChachaIetf::decrypt() must be of the type string, boolean

Go to this file:

vendor/magento/framework/Encryption/Adapter/SodiumChachaIetf.php

And Update Below Code:

$plainText = sodium_crypto_aead_chacha20poly1305_ietf_decrypt(
            $payload,
            $nonce,
            $nonce,
            $this->key
        );
        if ($plainText == false)
        {
          return "";
        }
        return $plainText;
0

Try this one and let me know the result.

php bin/magento setup:static-content:deploy -f

0

Can you check that you are using the proper crypt key for the database used? Magento's Encryption process will not work if the crypt used for encryption in the database is different than the one declared in the env.php file.

If you have no idea where to get the proper crypt file, you may copy the crypt hash from the magento instance that dumped the database that you are using.

Clear your cache afterwards by deleting them manually.

0

Different key to what was in place when you installed site against what's now in place will cause this issue

Once lost no way to get back

Will only affect handful of extensions that rely on reversible encryption

Magento solution is this

https://magento.stackexchange.com/a/278420/70343

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.