• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeIgniter 4.0 Release framework - Kint Error

#1
Goodmorning everyone.

I updated my application using CodeIgniter 4 framework I got the following error:

Code:
Class 'Kint \ Renderer \ Renderer' not found



I investigated and found that the CodeIgniter 4 framework composer.json file is out of date


Code:
"require": {
         "kint-php / kint": "^ 2.1",
         "zendframework / zend-escaper": "^ 2.5"
     }


instead of


Code:
"require": {
         "kint-php / kint": "^ 3.3",
         "laminas / laminas-escaper": "^ 2.6"
     }
Codeigniter 4 - Docker Image [github] [docker hub]
Reply

#2
It didn't work when I tried it either so modified:
File: index.php
Code:
<?php DECLARE(STRICT_TYPES=1);
  error_reporting(-1); // regardless

  define('CI_DEBUG', FALSE); // bypass (bool) app/Config/oot/development.php

File: /system/CodeIgniter.php
Code:
        /**
         * Config\Kint
        */
    if( defined('CI_DEBUG') && CI_DEBUG):
        $config = config('Config\Kint');

        \Kint::$max_depth           = $config->maxDepth;
        \Kint::$display_called_from = $config->displayCalledFrom;
        \Kint::$expanded            = $config->expanded;

        if (! empty($config->plugins) && is_array($config->plugins))
        {
            \Kint::$plugins = $config->plugins;
        }

        \Kint\Renderer\RichRenderer::$theme  = $config->richTheme;
        \Kint\Renderer\RichRenderer::$folder = $config->richFolder;
        \Kint\Renderer\RichRenderer::$sort   = $config->richSort;
        if (! empty($config->richObjectPlugins) && is_array($config->richObjectPlugins))
        {
            \Kint\Renderer\RichRenderer::$object_plugins = $config->richObjectPlugins;
        }
        if (! empty($config->richTabPlugins) && is_array($config->richTabPlugins))
        {
            \Kint\Renderer\RichRenderer::$tab_plugins = $config->richTabPlugins;
        }

        \Kint\Renderer\CliRenderer::$cli_colors         = $config->cliColors;
        \Kint\Renderer\CliRenderer::$force_utf8         = $config->cliForceUTF8;
        \Kint\Renderer\CliRenderer::$detect_width       = $config->cliDetectWidth;
        \Kint\Renderer\CliRenderer::$min_terminal_width = $config->cliMinWidth;
    endif; // ($useKint):
    }

Updated the Online Strict Version with the new app/Views/welcome_message.php:

https://ci4-strict.tk/welcome-new

and testing from from London, UK based web host:

https://tools.pingdom.com/#5c1dd69bcc800000

Performance grade: 100%
Page size: 15.0 KB
Load time: 127 ms
Requests: 2
Reply

#3
I'm getting this same error after updating to 4.0.0., with the error on line 232

Code:
 /**
228          * Config\Kint
229          */
230         $config = config('Config\Kint');
231
232         \Kint::$max_depth           = $config->maxDepth;
233         \Kint::$display_called_from = $config->displayCalledFrom;
234         \Kint::$expanded            = $config->expanded;
235
236         if (! empty($config->plugins) && is_array($config->plugins))
237         {
238             \Kint::$plugins = $config->plugins;
239         }
Designer, developer and Diet Dr. Pepper addict. Messing up PHP since <?= $when['year';] ?>
Reply

#4
I noticed that @lonnieezell updated the version of Kint in composer.json

I edited in my composer.json

from
Code:
"codeigniter4 / framework": "^ 4 @ rc",

to
Code:
"codeigniter4 / framework": "dev-master",


This solved the problem
Codeigniter 4 - Docker Image [github] [docker hub]
Reply

#5
I think it's been fixed in the development branch on GitHub.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#6
I released a 4.0.1 version of everything that should have fixed the issue with Kint. Unfortunately, I'm now getting another issue that didn't show up during final testing last night on the refactor of our test suite. Unfortunately, I'm out of time until later tonight to work on this.

A temporary fix for those that need it is to remove the file tests/_support/Commands/CommandsTestStreamFilter.
Reply

#7
Thanks so much!
Codeigniter 4 - Docker Image [github] [docker hub]
Reply

#8
I am still getting the error even after removing the CommandsTestStreamFilter.php file. I also tried moving to the dev branch but error still persists. I just rolled back to 4.0.0-rc.4 for now. I know you guys are all working incredibly hard on this and my gratitude is through the roof. Thanks for all that you do.
Reply

#9
I'm still getting a Kint error even on 4.0.1, so I've just set my composer back to RC 4 for the moment.

This got me back up and running:

Code:
"codeigniter4/framework": "4.0.0-rc.4"

The error I'm still getting on 4.0.1. is:

Code:
ErrorException
Trying to get property 'maxDepth' of non-object search →

SYSTEMPATH/CodeIgniter.php at line 232

225         }
226
227         /**
228          * Config\Kint
229          */
230         $config = config('Config\Kint');
231
232         \Kint::$max_depth           = $config->maxDepth;
233         \Kint::$display_called_from = $config->displayCalledFrom;
234         \Kint::$expanded            = $config->expanded;
235
236         if (! empty($config->plugins) && is_array($config->plugins))
237         {
238             \Kint::$plugins = $config->plugins;
239         }
Designer, developer and Diet Dr. Pepper addict. Messing up PHP since <?= $when['year';] ?>
Reply

#10
What fixed it for me (v4.0.0) was to run composer update
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.