0

I created a bundle named UserBundle and when I needed to remove it I did this exacly :

  1. Unregister the Bundle in the AppKernel
  2. Remove Bundle Configuration 2.1 Remove Bundle Routing 2.2 Remove Bundle Configuration
  3. Remove the Bundle from the Filesystem 3.1 Remove Bundle Assets
  4. Remove Integration in other Bundles

but when I try to exec soms command this is what I Get :

[Symfony\Component\Config\Exception\FileLoaderLoadException] Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file? in @UserBundle/Resources/config/s ervices.yml (which is being imported from "C:\xampp\htdocs\MT\app/config\config.yml"). Make sure the "UserBundle/Resources/config/services.yml" bundle is correctly registered an d loaded in the application kernel class. If the bundle is registered, make sure the bundle path "@UserBundle/Resources/config/services.yml" is not empty.

[InvalidArgumentException] Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file?

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception

[RuntimeException] An error occurred when executing the ""cache:clear --no-warmup"" command:

[Symfony\Component\Config\Exception\FileLoaderLoadException] Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file? in @UserBundle/Resources/config/services.yml (which is being imported from "C:\xampp\htdocs\MT\app/config\config.yml"). Make sure the "UserBundle/Resources/config/services.yml" bundle is correctly registered and loaded in the application kernel class. If the bundle is registered, make sure the bundle path "@UserBundle/Resources/config/services.yml" is not empty.

When I Refresh the server 'http://127.0.0.1/mt/web/' I get :

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file?' in C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php:198 Stack trace: #0 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php(232): Symfony\Component\HttpKernel\Kernel->getBundle('UserBundle', false) #1 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Config\FileLocator.php(51): Symfony\Component\HttpKernel\Kernel->locateResource('@UserBundle/Res...', NULL, false) #2 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoader.php(147): Symfony\Component\HttpKernel\Config\FileLocator->locate('@UserBundle/Res...', 'C:\xampp\htdocs...', false) #3 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoader.php(101): Symfony\Component\Config\Loader\FileLoader-> in C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoader.php on line 179

5
  • Is the bundle referenced in the composer.json file? You probably need to remove that too. Commented Sep 11, 2017 at 3:50
  • Did you clean the cache?. Try rm -rf app/cache/* Commented Sep 11, 2017 at 6:57
  • it's not referenced in the composer.json Commented Sep 11, 2017 at 9:39
  • i couldn't clear the cache cus when i try to execute any command i get that lovely error msg Commented Sep 11, 2017 at 9:41
  • As @ste suggested, use rm -r app/cache/* to clear the cache from the command line. Think of this as a superuser cache clear. There are times when you can't run the console command due to that changes that you made. And this is one of them. Commented Sep 11, 2017 at 12:35

3 Answers 3

1

In C:\xampp\htdocs\MT\app\config\config.yml you may have something like:

imports:
    - { resource: @UserBundle/Resources/config/services.yml }

and possibly a configuration section related to the user bundle, i.e.

user_bundle:
    ...

You have to manually remove both to make everything working again.

Sign up to request clarification or add additional context in comments.

Comments

0
  1. Can you check if you use this bundle in app/config/service.yml

  2. If it's not working, try to search with your IDE (integrated development environment) your bundle inside your project. If you find some results, just remove them.

  3. Clear the cache

1 Comment

i removed every appearence of "UserBundle" but when i try to clear the cache using : php bin/console cache:clear --no-warmup -e prod it doesnt execute the commande
0

Try to clear cache manually by removing those folders : "var\cache\dev" and "var\cache\prod" for Symfony 3.x or "app\cache\dev" and "app\cache\prod" for Symfony 2.x .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.