Uncaught Error: Class 'App\Kernel' not found

好久不见. 提交于 2021-01-29 16:34:57

问题


I'm currently facing an important issue when i want to run any "php bin/console" command:

Symfony\Component\ErrorHandler\Error\ClassNotFoundError^ {#29
#message: """
    Attempted to load class "Kernel" from namespace "App".\n
    Did you forget a "use" statement for "Symfony\Component\HttpKernel\Kernel"?
    """
  #code: 0
  #file: "./bin/console"
  #line: 41
}
2020-06-11T15:43:20+00:00 [critical] Uncaught Error: Class 'App\Kernel' not found

While my Kernel.php class is normally defined in src/Kernel.php

I am working with Symfony 5


回答1:


I manage to solve my issue performing 3 successive actions :

  1. delete "vendor" folder (I saved it in another folder just in case)

  2. delete "cach-dev" folder

  3. run "composer update" command

Hope it can help other people to solve their issue



来源:https://stackoverflow.com/questions/62328310/uncaught-error-class-app-kernel-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!