codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.31k stars 1.89k forks source link

Bug: Class 'Kint\Renderer\Renderer' not found #2605

Closed arif98741 closed 4 years ago

arif98741 commented 4 years ago

Issue During running spark in my terminal I am facing Render not found error.

CodeIgniter version Codeigniter 4

Error Response ` $ php spark serve An uncaught Exception was encountered

Type: Error Message: Class 'Kint\Renderer\Renderer' not found Filename: C:\wamp64\www\ci4\vendor\codeigniter4\framework\system\Config\Config.php Line Number: 124 `

Context

arif98741 commented 4 years ago

sc

sba commented 4 years ago

same error here with "php spark serve"

error also occures when running on xampp localhost; http://codeigniter4.local/public/ with php 7.3.6, Apache 2.4 on win10

jlamim commented 4 years ago

I had the same problem

Windows 10 + PHP 7.4 + Apache 2.4.41 (Wamp)

niteraven7 commented 4 years ago

Same issue with 'php spark serve' not running but different error.

composer updated from rc4 to 4.0.0

php spark serve An uncaught Exception was encountered

Type: ErrorException Message: Trying to get property 'maxDepth' of non-object Filename: /home/parkmo2020/parkmo/vendor/codeigniter4/framework/system/CodeIgniter.php Line Number: 232

    Backtrace:
                                            -232 - /home/parkmo2020/parkmo/vendor/codeigniter4/framework/system/CodeIgniter.php::errorHandler
                                                            -193 - /home/parkmo2020/parkmo/vendor/codeigniter4/framework/system/CodeIgniter.php::initializeKint
                                                            -168 - /home/parkmo2020/parkmo/vendor/codeigniter4/framework/system/bootstrap.php::initialize
                                                            -44 - /home/parkmo2020/parkmo/spark::require

parkmo2020@cloudshell:~/parkmo (strong-charge-262521)$ php -v PHP 7.2.28-1+0~20200220.36+debian9~1.gbpcf4a75 (cli) (built: Feb 20 2020 14:17:10) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.28-1+0~20200220.36+debian9~1.gbpcf4a75, Copyright (c) 1999-2018, by Zend Technologies

on google cloud php72

arif98741 commented 4 years ago

@niteraven7 You are gettin different error with same command php spark serve
strange

lonnieezell commented 4 years ago

You all fail to mention whether this is a new install or an existing install. Is this based on the main repo, or the app starter?

Looks like I still need to learn more about how the release scripts builds things out, since I did change where I thought the composer.json would come from but it didn't seem to propagate correctly. Change Kint version to 3.3 in composer.json and do a composer update. That should get it working for you.

jlamim commented 4 years ago

@lonnieezell I created a new installation to be able to verify this occurrence.

composer create-project codeigniter4/appstarter --no-dev

And I got the error mentioned at the opening of the Issue

arif98741 commented 4 years ago

its fresh install using composer create
fg

niteraven7 commented 4 years ago

app starter here. existing install rc4 updated to 4.0.0

more composer.json { "name": "codeigniter4/appstarter", "type": "project", "description": "CodeIgniter4 starter app", "homepage": "https://codeigniter.com", "license": "MIT", "require": { "php": ">=7.2", "codeigniter4/framework": "^4@rc" }, "require-dev": { "mikey179/vfsstream": "1.6.*", "phpunit/phpunit": "^7.0" }, "scripts": { "post-update-cmd": [ "@composer dump-autoload" ] }, "support": { "forum": "http://forum.codeigniter.com/", "source": "https://github.com/codeigniter4/CodeIgniter4", "slack": "https://codeigniterchat.slack.com" } }

jlamim commented 4 years ago

@lonnieezell

I made a new installation from codeigniter4/framework via composer to be able to compare the structure of composer.json in relation to codeigniter4/appstarter and there are differences between the composer.json files.

In codeigniter4/appstarter there is no explicit mention of "kint-php/kint" in 'require'.

The installation with "codeigniter4/framework" worked correctly, but the installation with "codeigniter4/appstarter" presented the reported problem.

When trying to update the kint package via composer (composer require kint-php/php) to the latest stable version in an installation via "codeigniter4/appstarter" it gives an error saying:

Your requirements could not be resolved to an installable set of packages.

- codeigniter4 / framework 4.0.0 requires kint-php / kint ^ 2.1 -> satisfiable by kint-php / kint [2.1, 2.1.1, 2.1.2, 2.2, 2.x-dev] but these conflict with your requirements or minimum-stability.
- codeigniter4 / framework 4.0.0 requires kint-php / kint ^ 2.1 -> satisfiable by kint-php / kint [2.1, 2.1.1, 2.1.2, 2.2, 2.x-dev] but these conflict with your requirements or minimum-stability.
- codeigniter4 / framework 4.0.0 requires kint-php / kint ^ 2.1 -> satisfiable by kint-php / kint [2.1, 2.1.1, 2.1.2, 2.2, 2.x-dev] but these conflict with your requirements or minimum-stability.
- Installation request for codeigniter4 / framework ^ 4.0 -> satisfiable by codeigniter4 / framework [4.0.0].

From this I believe that the problem lies in the dependency on Kint installed by default when running the "composer create-project codeigniter4/appstarter project-name".

Perhaps an update to composer.json will be enough to solve the problem.

jlamim commented 4 years ago

@lonnieezell

### codeigniter4/appstarter Requires php: >=7.2 codeigniter4/framework: ^4.0

### codeigniter4/framework Requires php: >=7.2 ext-curl: ext-intl: kint-php/kint: ^2.1 psr/log: ^1.1 zendframework/zend-escaper: ^2.5

DZywolf commented 4 years ago

@lonnieezell the change you made in the framework repo will not work until you delete the old release (4.0.0) and make a new one. also only way to access the change right now is by switching to "codeigniter4/framework": "dev-master"

lonnieezell commented 4 years ago

Yup. Working on it guys. Patience. :)

lonnieezell commented 4 years ago

Released 4.0.1 that fixed that. Unfortunately, it is now showing up an issue that I missed when reviewing our tests refactor last night. I won't have time until later tonight to fix that. A temporary fix is to remove the file: tests/_support/Commands/CommandsTestStreamFilter.php.

enix-app commented 4 years ago

Me too, on Linux Mint.

arif98741 commented 4 years ago

@enix-app Kint\Renderer not found in 4.0.1 but new bug appeared. hope it will be fixed soon. Capture

lonnieezell commented 4 years ago

@arif98741 That was mentioned by two comments previously. :)

musmanikram commented 4 years ago

@enix-app Kint\Renderer not found in 4.0.1 but new bug appeared. hope it will be fixed soon. Capture

Created fix for this issue: https://github.com/codeigniter4/CodeIgniter4/pull/2609

entrinix commented 4 years ago

Same issue with 'php spark serve' not running but different error.

composer updated from rc4 to 4.0.0

php spark serve An uncaught Exception was encountered

Type: ErrorException Message: Trying to get property 'maxDepth' of non-object Filename: /home/parkmo2020/parkmo/vendor/codeigniter4/framework/system/CodeIgniter.php Line Number: 232

    Backtrace:
                                            -232 - /home/parkmo2020/parkmo/vendor/codeigniter4/framework/system/CodeIgniter.php::errorHandler
                                                            -193 - /home/parkmo2020/parkmo/vendor/codeigniter4/framework/system/CodeIgniter.php::initializeKint
                                                            -168 - /home/parkmo2020/parkmo/vendor/codeigniter4/framework/system/bootstrap.php::initialize
                                                            -44 - /home/parkmo2020/parkmo/spark::require

parkmo2020@cloudshell:~/parkmo (strong-charge-262521)$ php -v PHP 7.2.28-1+0~20200220.36+debian9~1.gbpcf4a75 (cli) (built: Feb 20 2020 14:17:10) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.28-1+0~20200220.36+debian9~1.gbpcf4a75, Copyright (c) 1999-2018, by Zend Technologies

on google cloud php72

Copy the file:

https://raw.githubusercontent.com/codeigniter4/CodeIgniter4/develop/app/Config/Kint.php

Into the file "app/Config/Kint.php"

When updating from composer, this file is missing since it's new. This fixed it for me.

lonnieezell commented 4 years ago

Version 4.0.2 released that should fix all of this for a new install. Sorry about the release issues today.

vrochanet commented 4 years ago

Thanks for your work..

lnavarroa commented 4 years ago

Hi, I have the same problem, but i solved it by rename system/ThirdParty/Kint/kint.php to system/ThirdParty/Kint/Kint.php

arif98741 commented 4 years ago

@lnavarroa great. But 4.0.2 already fixed that issue.

lonnieezell commented 4 years ago

While updating the filename works, the correct solution is to update Composer to update your version from 2.x to 3.x like the framework has done, and copy over the new app/Config/Kint.php to your application.

kenjis commented 1 year ago

If you got this error with CodeIgniter v4.3, See https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_430.html#config-files