Answers.Body: <p>So what happened was I un-gitignored my Composer files so I could deploy them to another environment. Then I switched from that branch to a different branch with different Composer files. After I switched back, I ran into a Composer bug (<a href="https://docs.craftcms.com/v3/extend/plugin-guide.html#loading-your-plugin-into-a-craft-project" rel="nofollow noreferrer">mentioned here in the docs</a>) where Composer will forget about plugins loaded using the <code>path</code> method if the files change.</p>
  <p>So I had to perform these steps:</p>
  <ul>
  <li>navigate to my craft project folder in the terminal</li>
  <li>execute <code>composer remove kgrote/siteutilities</code></li>
  <li>delete the <code>kgrote</code> directory from <code>craft/vendor</code></li>
  <li>execute <code>composer require kgrote/siteutilities</code></li>
  </ul>
  <p>SUUUUUPER annoying, but there you have it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-01T16:53:20.517Z
Answers.Text: I've run into similar issues with a plugin that was not installed, and I could not remove through the CMS. The scenario you laid out was similar to my fix. The key for me was to pay very close attention to the error logging which generally does a very good job at helping to ferret out problems. I've even had to temporarily edit the source files of a plugin to keep it from trying to add DB tables that already existed due to a failed plugin update. Again, the key to solving the issue was in the error logs.
Answers.UserDisplayName: Vaughn D. Taylor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-01T01:38:18.983Z
Answers.LastActivityDate: 2024-03-13T19:04:52.670Z
Answers.LastEditDate: 2024-03-13T19:04:52.670Z
Answers.UserDisplayName: kmgdev
Answers.Body: <blockquote>
    <p>Additionally, the plugin shows as "Disabled" in the Settings area and I can't enable it.</p>
  </blockquote>
  
  <p>This seems like the crux of the problem. If you can figure out how to re-enable the plugin it should then be able to find the missing component class.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-29T00:05:17.300Z
Answers.Text: So what would cause a plugin to not be able to be enabled, then?
Answers.UserDisplayName: kmgdev
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-29T00:06:54.157Z
Answers.Text: ¯\\_(ツ)_/¯ No idea. It's kind of a separate question though, you may want to spin off a new SE thread.
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-28T23:21:09.327Z
Answers.LastActivityDate: 2018-12-28T23:21:09.327Z
Answers.UserDisplayName: Lindsey D
Body: <p>I'm suddenly getting an error on my plugin fieldtype even though I didn't make any changes to it. On Craft's publish page where my field is supposed to be I get the error:</p>
  
  <pre><code>Unable to find component class 'kgrote\siteutilities\fields\Regionselect'.
  </code></pre>
  
  <p>Really have no idea where to start looking here. The <code>Regionselect</code> class exists in the fieldtype file and the name of the file matches the class. It might help if I knew where this error was originating from.</p>
  
  <p>Additionally, the plugin shows as "Disabled" in the Settings area and I can't enable it, and there is no "Uninstall" option available in the dropdown.</p>
  
Tags: <plugin-development><custom-fieldtype>
Title: Plugin Error: "Unable to find component class"
ThreadText: # Plugin Error: "Unable to find component class"
  
  (Asked by: username_0 on 2018-12-28)
  
  I'm suddenly getting an error on my plugin fieldtype even though I didn't make any changes to it. On Craft's publish page where my field is supposed to be I get the error:
  
  ```
  Unable to find component class 'kgrote\siteutilities\fields\Regionselect'.
  
  ```
  
  Really have no idea where to start looking here. The `Regionselect` class exists in the fieldtype file and the name of the file matches the class. It might help if I knew where this error was originating from.
  
  Additionally, the plugin shows as "Disabled" in the Settings area and I can't enable it, and there is no "Uninstall" option available in the dropdown.
  
  **Tags:** plugin-development, custom-fieldtype
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2019-01-01. Score: 4 | Accepted answer
  
  So what happened was I un-gitignored my Composer files so I could deploy them to another environment. Then I switched from that branch to a different branch with different Composer files. After I switched back, I ran into a Composer bug ([mentioned here in the docs](https://docs.craftcms.com/v3/extend/plugin-guide.html#loading-your-plugin-into-a-craft-project)) where Composer will forget about plugins loaded using the `path` method if the files change.
  
  So I had to perform these steps:
  
  * navigate to my craft project folder in the terminal
  * execute `composer remove kgrote/siteutilities`
  * delete the `kgrote` directory from `craft/vendor`
  * execute `composer require kgrote/siteutilities`
  
  SUUUUUPER annoying, but there you have it.
  
  > **Comments:**
  > **username_1**: I've run into similar issues with a plugin that was not installed, and I could not remove through the CMS. The scenario you laid out was similar to my fix. The key for me was to pay very close attention to the error logging which generally does a very good job at helping to ferret out problems. I've even had to temporarily edit the source files of a plugin to keep it from trying to add DB tables that already existed due to a failed plugin update. Again, the key to solving the issue was in the error logs.  
  
  ---
  
  ### Answer by username_2 on 2018-12-28. Score: 1
  
  > Additionally, the plugin shows as "Disabled" in the Settings area and I can't enable it.
  
  This seems like the crux of the problem. If you can figure out how to re-enable the plugin it should then be able to find the missing component class.
  
  > **Comments:**
  > **username_0**: So what would cause a plugin to not be able to be enabled, then?  
  > **username_2**: ¯\\_(ツ)_/¯ No idea. It's kind of a separate question though, you may want to spin off a new SE thread.  
  
  ---
  
  