Contao 4.4.1: Uncaught LogicException: setProjectDir() must be called to initialize the ContaoKernel.
Closed this issue · 3 comments
HI,
I get the following error:
Fatal error: Uncaught LogicException: setProjectDir() must be called to initialize the ContaoKernel. in /vendor/contao/manager-bundle/src/HttpKernel/ContaoKernel.php on line 64
Here ist the Call Stack
'
1 | 0.0014 | 363128 | {main}( ) | .../api.php:0
2 | 0.0116 | 1016000 | DieSchittigs\ContaoContentApi\FrontendApi->__construct( ) | .../api.php:12
3 | 0.0158 | 1323568 | Symfony\Component\HttpKernel\Kernel->__construct( ) | .../FrontendApi.php:28
4 | 0.0158 | 1323568 | Contao\ManagerBundle\HttpKernel\ContaoKernel->getRootDir( ) | .../Kernel.php:84
5 | 0.0159 | 1323568 | Contao\ManagerBundle\HttpKernel\ContaoKernel->getProjectDir( ) | .../ContaoKernel.php:76
`
Installed via composer, got no error...
Thank you for your help!
When in replace FrontendApi Line 30
$kernel->setRootDir(dirname(DIR).'/app');
with
ContaoKernel::setProjectDir(dirname(DIR).'/app');
on line 28, this problem is solved.
Then i get
Fatal error: Uncaught InvalidArgumentException: Composer installed.json was not found at ".../vendor/dieschittigs/contao-content-api/app/vendor/composer/installed.json" in .../vendor/contao/manager-plugin/src/PluginLoader.php on line 134
Thanks for the report! Must be something with the latest Contao Version, I'll look into it
I'm currently migrating the code into a Symfony Bundle. This should be fixed with the next release