Problem/Motivation
I have Kint working as normal and I have added in the Devel Kint Extras module but I am not seeing those 'extras' that I once knew and loved!.
My Kint out out still looks like this...

Steps to reproduce
To clarify, I am attempting to Kint a simple Node in a pre-process function using this code...
if (\Drupal::moduleHandler()->moduleExists('devel')) {
dpm($variables);
}
And I have set up Devel to use Kint.
I cannot seem to use the kint() functions directly because I get a "Headers already sent" error when I do.
If anyone can help that would be great.
Thanks
Comments
Comment #2
Phil Wolstenholme commentedHave you tried
ksm(Kint Set Message) instead?Comment #3
jksloan2974 commentedI have the same issue with kint extras not showing methods.
Comment #4
Hamulus commentedthe same issue for me: no extras when Kint extended is selected
Comment #5
Phil Wolstenholme commentedI ended up using this patch for the Devel module instead of the
devel_kint_extrasmodule:https://raw.githubusercontent.com/politsin/snipets/d7b610a369b24c1dacf07...
The patch isn't my work, it's taken from https://gitlab.com/drupalspoons/devel/-/issues/221#note_430060927
Comment #6
drupalfan2 commentedSame problem here.
Why it is not possible to use the "Devel Kint Extras" module as in Drupal 8?
And later when the devel patch will be applied? What will be then the best way to debug with kint() (including available methods of the object)?
Comment #7
nitinsp commentedSame issue for me, I have install Devel kint Extra module using composer and enable it. Then set Variable dumper as kint extended, but still not able see methods in kint.
Is any other way apart from kint to see methods?
Comment #8
clairedesbois@gmail.comIdem for me, the module doesn't work for Drupal 8.9 and Devel 4.1.
If I apply the patch of #5, the memory explodes and the website crashes.
Comment #9
drupalfan2 commentedThis is an essential module!
Why isn't this solved?
Comment #10
clairedesbois@gmail.comI tried something with the patch #5, I add the code to limit the number of depth Kint can display (like the precedent version). Of course, I changed a bit the code comparatively at Devel 2.
After applied the patch #5, you can add in you settings.local.php to prevent memory errors:
With that, it works
Comment #11
drupalfan2 commentedBut this essential module should work without any patch.
Comment #12
laborouge commented+1
Comment #13
drupalfan2 commented+1
Comment #14
ash2303 commentedFollow below steps:
- Apply patch
- If module is already enabled, disable & enable again (important to set module weight)
- Go to admin/config/development/devel and change Variables Dumper setting to Kint Extended
- Clear Cache
It should work as required.
Comment #15
ash2303 commentedComment #16
ash2303 commentedComment #17
drupalfan2 commentedI am using Devel Kint Extras extra module and the correct settings.
But patch #15(#16) does not bring me back the "Available methods" and "Static class properties" sections in the kint() command output.
I am using the following drupal-kint.patch for the devel modul to get this work.
But again:
We need a commited solution for everyone (without need of a patch). Who can take care of it?
Comment #18
ash2303 commentedIf you follow the steps correctly the patch will work fine. Let me know, I will attach a video if required.
Comment #19
drupalfan2 commentedI am still using this patch. So please do NOT remove it again!
Comment #20
luke adams commentedPatch from #17/#19 (they're the same one) is working for me, thanks!
Comment #21
maskedjellybeanDang, patch #15 (comment #16) gives me a white screen when I try to use kint() in a Twig template.
Patch #17/19 does not apply. Commenting out code doesn't look like a legitimate way to solve the issue so I'm a bit skeptical of that approach.
Comment #22
maskedjellybeanI'm sorry, #15/#16 does work! I can see the methods. Thank you so much!
I was overloading Kint and crashing the page. I added this to settings.local.php to fix:
Comment #23
no sssweat commentedThe patch from comment #16 works but only when you click the Devel tab. IE: Only when you're the in
/devel/node/xxxpath.If you do
kint($node);in code, it doesn't show the methods nor static properties.In contrast, patch from comment #19 will show the methods and static properties when you
kint($node);in code. However, should be noted that is patching the devel module rather than the devel_kint_extras module.Comment #24
khurrami commentedThanks #5 worked for me
Comment #26
dieterholvoet commentedThe patches from #14 and #16 are not an ideal approach since they are overriding procedural code and especially since it requires re-enabling the module.
The patches from #17/#19 do not belong here, they are to be applied to the Devel module. If you want to take that approach instead of using this module, use this patch from the original issue or post a new patch in the original issue in case it doesn't apply anymore.
I'll update the module description to make it clear that you need to set
Kint::$max_depthin order to prevent out-of-memory issues. I'll also provide a fix for this issue in a MR.Comment #28
dieterholvoet commentedI fixed the issue. Here's a patch to use for testing in your projects. Make sure the devel patch mentioned earlier in this issue is no longer applied when testing this patch.
Comment #29
dieterholvoet commentedComment #30
dieterholvoet commentedThinking about it, this only fixes the case where you're using the kint Twig function, not the PHP function. I think an overall better approach would be to override the standard kint plugin instead of introducing a new one. It will allow for simpler code in this module and less workarounds. The only drawback I can think of is that you can't use both the standard and the extended Kint at the same time anymore, although I think that doesn't even work right now. Setting back to Needs work to try out this new approach.
Comment #31
dieterholvoet commentedI proposed automatically overriding the default Kint dumper after enabling the module in #3309491: Override the default kint dumper. Doing that would fix all issues reported here, and the fix would be cleaner than the one that was previously posted here. Feedback is welcome in that issue, especially if you have any objections.
Comment #32
dieterholvoet commentedComment #33
dieterholvoet commentedClosing this since #3309491: Override the default kint dumper was merged. I'm transferring credit to that issue.
Comment #34
drupalfan2 commentedPatch is no longer needet?