Symfony4 Error loading classes custom folder “Expected to find class… but it was not found”

让人想犯罪 __ 提交于 2019-12-04 01:47:49

Update your composer.json autoload setup

{
    [...]
    "autoload": {
        "psr-4": {
            "TestNamespace\\": "TestNamespace/",
            "": "src/"
        }
    },
    [...]
}

After run: composer dump-autoload and try again.

composer dump-autoload --classmap-authoritative will only work if your src directory is present at the time you run the command.

This can be an issue with multi-stage Docker builds in particular, when you are normally only copying the composer.json/composer.lock into the build image.

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