How to fix errors when updating to shopware v6.6
April 4, 2024 - Reading time: 7 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.
---
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"
Please don't hesitate to contact me if you need any more help with other issues.