filament-knowledge-base icon indicating copy to clipboard operation
filament-knowledge-base copied to clipboard

[Bug]: Nested too deeply - Weird behavior on Windows

Open Mathissou01 opened this issue 3 months ago • 1 comments

Environment

  • Package: guava/filament-knowledge-base v2.0.0
  • Installation: Fresh install (cache cleared and Filament assets published)

Issue I’m encountering the following error message:

The file "projet_folder.docs.knowledge-base.fr.01-getting-started" is nested too deeply. 
The maximum nesting depth is 3.

Current Directory Structure

/projet_folder
  /docs
    /knowledge-base
      /fr
        01-getting-started.md

KnowledgeBasePanelProvider:

->id('knowledge-base')
->path('knowledge-base')
->plugins([
    KnowledgeBasePlugin::make()
])

ConsultantPanelProvider:

KnowledgeBaseCompanionPlugin::make()
    ->knowledgeBasePanelId('knowledge-base')

Configuration (config/filament-kb.php):

return [
    'flatfile-model' => FlatfileNode::class,

    'cache' => [
        'prefix' => env('FILAMENT_KB_CACHE_PREFIX', 'filament_kb_'),
        'ttl' => env('FILAMENT_KB_CACHE_TTL', 'forever'),
    ],
];

Expected Behavior According to the [official documentation](https://github.com/GuavaCZ/filament-knowledge-base/blob/main/docs/v2/introduction.md), this structure should be valid.


Steps to Reproduce

  1. Install the package via Composer on a fresh Filament setup.
  2. Run php artisan cache:clear.
  3. Run php artisan filament:assets.
  4. Create the directory structure shown above.

Expected Result The documentation page should load correctly without nesting errors.

Actual Result An error is thrown indicating that the file is nested too deeply.


Question Why am I still getting this “maximum nesting depth” error, even though the structure seems to match the documented example?


Info The issue seems to appear only on Windows but not on MacOS.


Package Version

2.0.0

PHP Version

8.2.0

Laravel Version

11.9.0

Which operating systems does with happen with?

Windows

Mathissou01 avatar Oct 09 '25 10:10 Mathissou01

@palmer-dev Found a solution that works on Windows. The issue didn’t occur on Linux or macOS.

->plugins([
    KnowledgeBasePlugin::make(base_path('docs' . DIRECTORY_SEPARATOR . 'knowledge-base')),
])

The problem was caused by the different directory separators used on Windows versus Linux/macOS. Using PHP’s built-in DIRECTORY_SEPARATOR constant ensures compatibility across all operating systems.

Mathissou01 avatar Oct 15 '25 09:10 Mathissou01

Thanks this also fixed my problem!

Sjoerd24 avatar Dec 03 '25 06:12 Sjoerd24

Fixed in 2.1.1

lukas-frey avatar Dec 08 '25 19:12 lukas-frey