shopware / dev-tools

MIT License
6 stars 1 forks source link

Bundle "WebProfilerBundle" does not exist or it is not enabled. Maybe you forgot to add it in the "registerBundles()" method of your "Shopware\Core\Kernel.php" file? #5

Open qx54 opened 1 month ago

qx54 commented 1 month ago

I'm on Shopware 6.6.2.0, installed via Symfony flex.

When running composer require --dev shopware/dev-tools

I got the following error:

./composer.json has been updated
Running composer update shopware/dev-tools
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - shopware/dev-tools 1.2.0 requires phpunit/phpunit ^9.6 -> satisfiable by phpunit/phpunit[9.6.0, ..., 9.6.19].
    - shopware/dev-tools 1.3.0 requires phpunit/phpunit ^9.6 | ^10 -> satisfiable by phpunit/phpunit[9.6.0, ..., 9.6.19, 10.0.0, ..., 10.5.21].
    - shopware/dev-tools[1.0.0, ..., 1.1.0] require symfony/web-profiler-bundle ^5.4 | ^6 -> found symfony/web-profiler-bundle[v5.4.0, ..., v5.4.40, v6.0.0, ..., v6.4.8] but it conflicts with your root composer.json require (^7.0).
    - phpunit/phpunit[9.6.0, ..., 9.6.19] require sebastian/diff ^4.0.3 -> found sebastian/diff[4.0.3, 4.0.4, 4.0.5, 4.0.6] but the package is fixed to 6.0.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - phpunit/phpunit[10.0.0, ..., 10.5.21] require sebastian/diff ^5.0 -> found sebastian/diff[5.0.0, ..., 5.1.1] but the package is fixed to 6.0.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires shopware/dev-tools * -> satisfiable by shopware/dev-tools[1.0.0, ..., 1.3.0].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require shopware/dev-tools:*" to figure out if any version is installable, or "composer require shopware/dev-tools:^2.1" if you know which you need.

Thus I ran: composer require --dev shopware/dev-tools --with-all-dependencies which worked.

But when opening a product page in the browser, I get the following error:

Bundle "WebProfilerBundle" does not exist or it is not enabled. Maybe you forgot to add it in the "registerBundles()" method of your "Shopware\Core\Kernel.php" file? in @WebProfilerBundle/Resources/config/routing/wdt.xml (which is being imported from "/home/web/www.shop.de/config/routes/web_profiler.yaml"). Make sure the "WebProfilerBundle" bundle is correctly registered and loaded in the application kernel class. If the bundle is registered, make sure the bundle path "@WebProfilerBundle/Resources/config/routing/wdt.xml" is not empty.

Is this not compatible with Shopware 6.6 or what's the issue?

mitelg commented 1 month ago

make sure, that the APP_ENV variable is set correctly. See https://github.com/shopware/shopware/blob/trunk/config/bundles.php#L23

it is probably set to prod

qx54 commented 1 month ago

It is set to dev

mitelg commented 1 month ago

did you try the --with-all-dependencies option like suggested? :thinking:

qx54 commented 1 month ago

Yes I did run it with the --with-all-dependencies option, see my second part of the initial post.

That's when the installation process went through, but the main issue occurred.

mitelg commented 1 month ago

how does your config/bundles.php look like?

qx54 commented 1 month ago

I checked that already, the WebProfilerBundle line is there.

config/bundles.php:

<?php

return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
    Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
    Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true],
    Shopware\Core\Framework\Framework::class => ['all' => true],
    Shopware\Core\System\System::class => ['all' => true],
    Shopware\Core\Content\Content::class => ['all' => true],
    Shopware\Core\Checkout\Checkout::class => ['all' => true],
    Shopware\Core\Maintenance\Maintenance::class => ['all' => true],
    Shopware\Core\DevOps\DevOps::class => ['e2e' => true],
    Shopware\Core\Profiling\Profiling::class => ['all' => true],
    Shopware\Administration\Administration::class => ['all' => true],
    Shopware\Elasticsearch\Elasticsearch::class => ['all' => true],
    Shopware\Storefront\Storefront::class => ['all' => true],
    Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true],
];

I can give you access to the server if that helps.

mitelg commented 1 month ago

that looks okay :thinking: sorry, I have then no further idea. maybe @shyim can help

qx54 commented 1 month ago

Thank you nevertheless, it's much appreciated.