InvalidArgumentException: Class "\Drupal\ckeditor_ai_agent\Form\AiAgentSettingsForm" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 32 of C:\wamp64\www\dummydr\web\core\lib\Drupal\Core\DependencyInjecti

Created on 20 March 2025, 16 days ago

Problem/Motivation

InvalidArgumentException: Class "\Drupal\ckeditor_ai_agent\Form\AiAgentSettingsForm" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 32 of C:\wamp64\www\dummydr\web\core\lib\Drupal\Core\DependencyInjection\ClassResolver.php).

Steps to reproduce

Installed Ai and open ai module
configure it with api key
Then installed ckeditor_ai_agent module
Go to admin/config
Click on the CKEditor AI Agent to config

Proposed resolution

Error should not come and configuration form should come

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇮🇳India AditiVB

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @AditiVB
  • 🇮🇳India kulpratap2002

    Working on it.

  • 🇮🇳India kulpratap2002

    I have tried the things below

    1. Debugging Class Loading & Autoload Issues

    • Verified Composer autoloading: lando composer dump-autoload -o
    • Checked CKEditor AI Agent’s namespace in composer.json
    • Findings: No immediate resolution; issue persisted when OpenAI was enabled.

    2. Checking Dependency Conflicts

    • Checked module dependencies:
      lando drush pm:list --status=enabled | grep openai
    • Investigated if OpenAI modifies dependency injection.
    • Findings:

      OpenAI requires guzzlehttp/guzzle, which could affect service resolution.

      No direct conflicts found, but OpenAI modifies service injection.

    3. Testing OpenAI Event Subscriber & Dependency Injection Conflicts

    • Disabled OpenAI’s Event Subscriber in openai.services.yml.
    • Rebuilt cache and tested again (still Issue persisted).
    • Debugged class resolution:
      $resolver = \Drupal::service('class_resolver'); dpm($resolver->getInstanceFromDefinition('Drupal\ckeditor_ai_agent\Form\AiAgentSettingsForm'));
Production build 0.71.5 2024