Closed anchovy closed 8 months ago
Do you already have a plugin installed with the handle test
?
Getting the same error when trying to create a new field-type using the ReadMe sample:
php craft make field-type --plugin=foo-bar
Exception 'craft\errors\InvalidPluginException' with message 'No plugin exists with the handle "foo-bar".'
Should the module or plugin already exist before running the generator?
Versions: "craftcms/cms": "4.4.10.1", "craftcms/generator": "1.4.0",
Edited to answer my own question: the module needs to be generated first, before you can create a field-type. I jumped the gun and scrolled down to the components where I saw the field-type example in the ReadMe. For anyone else who is confused or gets stuck on this, start with the module generator first:
php craft make module my-test
composer dump-autoload
php craft make field-type --module=my-test
Should the module or plugin already exist before running the generator?
Yes.
Description
When trying to create a new field type I'm getting the error:
No plugin exists with the handle "test"
I'm following the docs so not sure what's going on?Steps to reproduce
Exception 'craft\errors\InvalidPluginException' with message 'No plugin exists with the handle "test".'
in /site/vendor/craftcms/cms/src/services/Plugins.php:889
Stack trace:
0 /site/vendor/craftcms/generator/src/Command.php(200): craft\services\Plugins->createPlugin('test')
1 [internal function]: craft\generator\Command->actionGenerate('field-type')
2 /site/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
3 /site/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
4 /site/vendor/yiisoft/yii2/console/Controller.php(180): yii\base\Controller->runAction('', Array)
5 /site/vendor/craftcms/cms/src/console/ControllerTrait.php(87): yii\console\Controller->runAction('', Array)
6 /site/vendor/craftcms/cms/src/console/Controller.php(217): craft\console\Controller->traitRunAction('', Array)
7 /site/vendor/craftcms/generator/src/Command.php(131): craft\console\Controller->runAction('', Array)
8 /site/vendor/yiisoft/yii2/base/Module.php(552): craft\generator\Command->runAction('', Array)
9 /site/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('make', Array)
10 /site/vendor/craftcms/cms/src/console/Application.php(90): yii\console\Application->runAction('make', Array)
11 /site/vendor/yiisoft/yii2/console/Application.php(147): craft\console\Application->runAction('make', Array)
12 /site/vendor/craftcms/cms/src/console/Application.php(121): yii\console\Application->handleRequest(Object(craft\console\Request))
13 /site/vendor/yiisoft/yii2/base/Application.php(384): craft\console\Application->handleRequest(Object(craft\console\Request))
14 /site/craft(13): yii\base\Application->run()
15 {main}