collision
collision copied to clipboard
[Feature Request] Override console verbosity for early exceptions
I was running into an issue where an exception was thrown early in the Laravel boot process (routing setup). Unfortunately, for whatever reason, console verbosity (from the artisan command line) doesn't seem to be set at this point so Writer::renderTrace always skips vendor frames at this point and stops after one frame.
I'm not sure this package can do anything about the lack of information, so I would suggest something like a config option or environment variable I could set to supercede the dependency on the set console verbosity level and just shows me all exception frames in such scenarios.
I'm running into a similar issue, but I think it might be a Laravel issue that's present even without this package.
I'm currently upgrading one of our applications to Laravel 8 and PHP 8.1, and I've run into an error on the php artisan package:discover step of composer dump-autoload. I'm having trouble debugging what's happening because the relevant "vendor frames" are hidden.
When I try to run package:discover manually and increase verbosity with -vvv, I'd expect all vendor frames to be shown, but it seems that -vvv does not reveal the hidden vendor frames:
$ php artisan package:discover -vvv
TypeError
Illuminate\View\FileViewFinder::__construct(): Argument #2 ($paths) must be of type array, null given, called in /path/to/vendor/laravel/framework/src/Illuminate/View/ViewServiceProvider.php on line 76
at vendor/laravel/framework/src/Illuminate/View/FileViewFinder.php:53
49â–• * @param array $paths
50â–• * @param array|null $extensions
51â–• * @return void
52â–• */
➜ 53▕ public function __construct(Filesystem $files, array $paths, array $extensions = null)
54â–• {
55â–• $this->files = $files;
56â–• $this->paths = array_map([$this, 'resolvePath'], $paths);
57â–•
+30 vendor frames
31 [internal]:0
Illuminate\Foundation\Application::Illuminate\Foundation\{closure}(Object(Aic\Hub\Foundation\Providers\ResourceServiceProvider))
+5 vendor frames
37 artisan:32
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
I removed "nunomaduro/collision": "^5.10" from my composer.json, ran composer update, encountered the same error again, and re-ran the command manually with -vvv:
$ php artisan package:discover -vvv
In FileViewFinder.php line 53:
Illuminate\View\FileViewFinder::__construct(): Argument #2 ($paths) must be of type array, null given, called in /path/to/vendor/laravel/framework/src/Illuminate/View/ViewServiceProvider.php on line 76
For anyone arriving here through search, I ran into this specific issue because my config/view.php was missing... don't ask. But all I want to note here is that from my experience, it seems that the -vvv flag is ignored by Laravel itself if things fail early enough in the boot process.
It's technically not ignored, the exception is thrown before the actual command code with all it's scaffolding (including parsing of the command line options) is run, so verbosity level is simply not available at that time.
Not sure how to fix this...
Configuration option 'always_verbose' maybe?