Skip to content

Error: Call to undefined method ...Application::add() in ...bin/alchemy during installation #321

@aalaap

Description

@aalaap

Describe the bug

Creating an MVC app throws this error towards the end:

Using version ^4.0 for leafs/alchemy
PHP Fatal error:  Uncaught Error: Call to undefined method Symfony\Component\Console\Application::add() in /home/user/Code/leaf-mvc-app/vendor/leafs/alchemy/bin/alchemy:22
Stack trace:
#0 /home/user/Code/leaf-mvc-app/vendor/bin/alchemy(119): include()
#1 {main}
  thrown in /home/user/Code/leaf-mvc-app/vendor/leafs/alchemy/bin/alchemy on line 22

❌  Could not scaffold extra options for leaf-mvc-app

However, instead of aborting, it still finishes up:

👉  Get started with the following commands:

   cd leaf-mvc-app
    leaf serve

🍁  Happy gardening!

Package versions in composer.json:

{
    "require": {
        "leafs/blade": "^4.0",
        "leafs/mvc-core": "^4.0",
        "leafs/leaf": "^4.0",
        "leafs/logger": "^4.0",
        "leafs/schema": "^0.1.1",
        "leafs/vite": "^0.3.0",
        "leafs/auth": "^5.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.24",
        "leafs/alchemy": "^4.0"
    }
}

To Reproduce

Steps to reproduce the behavior:

On a fresh system,

  1. composer global require leafs/cli -W
  2. leaf create leaf-mvc-app --mvc
  3. Choose the following when asked:
    1. ✔ Install application starter?: … Yes
    2. ✔ Select a view engine: › … tailwind
    3. ✔ Set up tests?: … Yes
    4. ✔ Set up docker?: … No

Expected behavior

The process should not throw any errors before the final 'Happy Gerdening!' message.

Additional context

Composer version 2.8.9 2025-05-13 14:01:37
PHP version 8.4.20 (/usr/bin/php8.4)
OS: Zorin OS 17.3 (Ubuntu 22.04 LTS)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions