How to fix errors when updating to shopware v6.6
April 4, 2024 - Reading time: 8 minutes
This article draws from my experience upgrading projects from 6.5 to 6.6. And I will also regularly update errors that we often encounter in this article.
ATTENTION:
- Before updating from Shopware 6.5 to 6.6, deactivate all plugins first. If you have an issue with the plugins during the update because you forgot to deactivate them, you can try to go to the plugin table and set 0 for the active column. You can ping me via WhatsApp if you're unsure what to do.
---
1. If you have an error with the message Uncaught Error: Class „Shopware\Core\HttpKernel“ not found
You have to update two files from your project. One is public/index.php and the other is bin/shopware or bin/console
First, you should get those files and updates from the shopware 6.6. In my article, I'm updating the project to shopware v6.6.0.2, so I will get the files here.
- public/index.php: https://github.com/shopware/shopware/blob/v6.6.0.2/public/index.php
- bin/shopware or bin/console: if you don't have the bin/shopware in your project, just get the code from bin/shopware.
After finishing, copy the files from v6.6 you should continue to run
composer update
Run migrations with:
bin/console system:update:finish
To force-update all config files, run this command:
composer recipes:update
---
2. If your JS-plugins within your theme or plugins don't work well.
Open the main.js file within your plugin and change it like below
Before:
import ExamplePlugin from './plugins/example.plugin';
window.PluginManager.register('Example', ExamplePlugin, '[data-example]');
After:
window.PluginManager.register('Example', () => import('./plugins/example.plugin'), '[data-example]');
If it's a PluginManager.override()
Before:
import MyListingExtensionPlugin from './plugin-extensions/listing/my-listing-extension.plugin';
window.PluginManager.override(
'Listing',
MyListingExtensionPlugin,
'[data-listing]'
);
After:
window.PluginManager.override(
'Listing',
() => import('./plugin-extensions/listing/my-listing-extension.plugin'),
'[data-listing]',
);
For more details, please check this one Registering async JS-plugins (optional)
---
3. Composer related issues.
Your Composer dependencies require a PHP version *
OR
shopware/administration v6.6.1.0 requires php ~8.2.0 || ~8.3.0 → your php version (8.1.27) does not satisfy that requirement.
If you are facing with this issue. Check your current php version by running php -v to check the current version and make sure you're using version 8.2 or 8.3. After that, open composer.json and change php in the require section to "php": "~8.2.0 || ~8.3.0"
4. Composer related issues.
In case you cannot create a media folder in Shopware and you got this issue
CRITICAL: Uncaught Error: assert($levelField instanceof TreeLevelField)
open the php.ini file then add
; don't evaluate assert()
zend.assertions=-1
You can see more about php.ini from the shopware document here
Please don't hesitate to contact me if you need any more help with other issues.