laravel / tinker

Powerful REPL for the Laravel framework.
https://laravel.com/docs/artisan#tinker
MIT License
7.34k stars 130 forks source link

Tinker broken in laravel 9.0.0 #142

Closed grota closed 2 years ago

grota commented 2 years ago

Description:

Seems like tinker is broken in laravel 9. Bootstrapping a new laravel 9.0.0 project via sail, launching ./artisan tinker followed by help results in

RuntimeException with message 'Too many arguments, expected arguments "command" "command_name".'

Issuing ls results in:

InvalidArgumentException with message 'Unknown namespace, class or function: s'

Steps To Reproduce:

driesvints commented 2 years ago

Seems like this is a breaking change in Symfony Console's v5.4.3 release. It works for me with v5.4.2. Can you post an issue report on their tracker?

grota commented 2 years ago

done ⬆️ , btw, is symfony/console:^6.0 (introduced here https://github.com/laravel/framework/commit/03fa6a2566626920738d2c27eec20aad75be4561#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34R34 ) a required dependency? Meaning, can we mitigate the bug by using an alias dependency like "symfony/console": "5.4.2 as 6.0.2" ?

driesvints commented 2 years ago

it's a required dependency of Laravel yeah

grota commented 2 years ago

For people encountering the same issue, pinning symfony/console to 6.0.2 can be used a temporary workaround while a new 6.x release of symfony/console gets published.

bobthecow commented 2 years ago

It's broken in the latest point releases of Symfony 4.4, 5.3, 5.4, and 6.0. You can fix any of them by pinning to one version back.

ankurk91 commented 2 years ago

It is still broken for me. Even unable to exit from tinker.

Laravel v9.0.2 php v8.1.2 symfony/console v6.0.3

Everything is on their latest version.

https://github.com/symfony/symfony/pull/45240 The PR was merged 12 days ago, still broken :(

grota commented 2 years ago

6.0.3 is the one that has the bug, you/we need to wait the next point release

bobthecow commented 2 years ago

If you explicitly require symfony/console v6.0.2 it will fix it. Otherwise you need to wait for the next release. I believe it'll be in a week or so?