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

I wrote these tutorials for myself in future when I forget for the next steps.
Search for a command to run...

I wrote these tutorials for myself in future when I forget for the next steps.
No comments yet. Be the first to comment.
When you provision an Ubuntu instance on Oracle Cloud, you'll notice something different from standard Ubuntu installations: the system uses iptables instead of ufw for firewall management. This disti

When developing web applications locally, HTTPS is often overlooked. Yet, modern browsers and APIs increasingly require secure connections—even in development. That’s where mkcert comes in: a simple t

Testing the checkout success page in Magento 2 can be frustrating. By default, once an order is placed, Magento clears the quote session, meaning you can’t simply refresh or revisit the success page without going through the entire checkout process a...

Magento Commerce (EE) offers powerful features, but for many teams, Open Source (CE) is leaner, lighter, and more sustainable. If you're migrating from EE to CE, the Opengento downgrade tool provides a clean, scriptable way to remove proprietary modu...

If you’ve ever checked your Apache error logs and seen something like this: Code [core:error] (13)Permission denied: access to /robots.txt denied (filesystem path '/home/username/sites') because search permissions are missing on a component of the pa...

Magento 2 requires several PHP Extensions for the project, you can see the requirements here for Magento 2.4 and here for Magento 2.3.
And by that error, it's bit too general. For more detail about that error, you can try to monitor the logs of your magento by having 2 terminal sessions:
1 session to monitor log, and
tail -n 0 -f var/log/*
1 session to run the magento command
bin/magento setup:upgrade
By that issues, there are several possibility:
You can try to remove current crypt key on your app/etc/env.php file, and try to copy correct key file from existing project.

You can try to check this PHP extension by running php -info | grep mcrypt

if you dont see that extension, try to install it! in this case I'm using PHP 7.3, so I'm installing mcrypt for php7.3. If your PHP version is not 7.3, then just change the PHP version to match with your environment.
sudo apt install php7.3-mcrypt
If those 2 previous issues are not solving your problem, it could be code base issue and you need further investigation, and maybe you can use How to know more detail? step to investigate.
References:
https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements.html
https://magento.stackexchange.com/questions/278222/php-bin-magento-setupupgrade-issue
https://gist.github.com/pauloharaujos/bb6173d8f9e64d1b572fe24e55ec109f
https://meetanshi.com/blog/solution-type-error-occurred-when-creating-object-in-magento-2/