Valet: PHP Warning: Class 'Tightenco\Collect\Support\Debug\Dumper' not found in alias.php on line 18

Created on 5 Sep 2018  ·  23Comments  ·  Source: laravel/valet

I am attempting to start up Valet on my new MacBook Pro using High Sierra 10.13.6.

I have followed the instructions... brew update, brew install [email protected], etc however, when I run valet install, I am greeted with this stack trace.

Any help would be appreciated.

Thanks

Stack trace:

~/projects/test ⮀ valet install
PHP Warning: Class 'Tightenco\Collect\Support\Debug\Dumper' not found in /Users/joshmurray/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18
PHP Stack trace:
PHP 1. {main}() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:0
PHP 2. require() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:10
PHP 3. ComposerAutoloaderInit8ea7fb8c1f0e827c917dfbfde1721b9d::getLoader() /Users/joshmurray/.composer/vendor/autoload.php:7
PHP 4. composerRequire8ea7fb8c1f0e827c917dfbfde1721b9d() /Users/joshmurray/.composer/vendor/composer/autoload_real.php:56
PHP 5. require() /Users/joshmurray/.composer/vendor/composer/autoload_real.php:66
PHP 6. class_alias() /Users/joshmurray/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php:18

Warning: Class 'Tightenco\Collect\Support\Debug\Dumper' not found in /Users/joshmurray/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18

Call Stack:
0.0005 447352 1. {main}() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:0
0.0007 448496 2. require('/Users/joshmurray/.composer/vendor/autoload.php') /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:10
0.0008 463152 3. ComposerAutoloaderInit8ea7fb8c1f0e827c917dfbfde1721b9d::getLoader() /Users/joshmurray/.composer/vendor/autoload.php:7
0.0051 1309584 4. composerRequire8ea7fb8c1f0e827c917dfbfde1721b9d() /Users/joshmurray/.composer/vendor/composer/autoload_real.php:56
0.0052 1313520 5. require('/Users/joshmurray/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php') /Users/joshmurray/.composer/vendor/composer/autoload_real.php:66
0.0058 1456008 6. class_alias() /Users/joshmurray/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php:18

PHP Warning: Class 'Tightenco\Collect\Support\Debug\HtmlDumper' not found in /Users/joshmurray/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18
PHP Stack trace:
PHP 1. {main}() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:0
PHP 2. require() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:10
PHP 3. ComposerAutoloaderInit8ea7fb8c1f0e827c917dfbfde1721b9d::getLoader() /Users/joshmurray/.composer/vendor/autoload.php:7
PHP 4. composerRequire8ea7fb8c1f0e827c917dfbfde1721b9d() /Users/joshmurray/.composer/vendor/composer/autoload_real.php:56
PHP 5. require() /Users/joshmurray/.composer/vendor/composer/autoload_real.php:66
PHP 6. class_alias() /Users/joshmurray/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php:18

Warning: Class 'Tightenco\Collect\Support\Debug\HtmlDumper' not found in /Users/joshmurray/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18

Call Stack:
0.0005 447352 1. {main}() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:0
0.0007 448496 2. require('/Users/joshmurray/.composer/vendor/autoload.php') /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:10
0.0008 463152 3. ComposerAutoloaderInit8ea7fb8c1f0e827c917dfbfde1721b9d::getLoader() /Users/joshmurray/.composer/vendor/autoload.php:7
0.0051 1309584 4. composerRequire8ea7fb8c1f0e827c917dfbfde1721b9d() /Users/joshmurray/.composer/vendor/composer/autoload_real.php:56
0.0052 1313520 5. require('/Users/joshmurray/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php') /Users/joshmurray/.composer/vendor/composer/autoload_real.php:66
0.0064 1456040 6. class_alias() /Users/joshmurray/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php:18

Stopping nginx...
Installing nginx configuration...
Installing nginx directory...
Updating PHP configuration...
Restarting php...
Restarting dnsmasq...
Restarting nginx...

Valet installed successfully!

Most helpful comment

Composer global update should fix it for anyone else who runs into this. Or ‘composer global update Laravel/valet’ I think.

All 23 comments

I'm getting the same issue, it seems related to laravel/framework#25087.

Also relevant tightenco/collect#124

I broke it! Sorry! I will fix it as soon as I get my kids to bed ❤️

I've fixed this problem, but I can't figure out a way to make the fix go out until Laravel 5.7.2 comes out (because I can't tag Collect 5.7.2 with the fix, because then it would be out of sync with the Laravel components).

It’s a warning so I’m not seeing anything critical myself with it 😁

Yep, I was thinking the same thing; ignore the warning and it will go away as soon as we tag the next release. :) Thanks!

Reopening so people can find it until it’s fixed.

@mattstauffer Thank you for the quick fix and keeping this record !
Took me a while to find it but now I'm relieved 👍🥇

Good morning all.

I've just preformed a quick composer global update and I received the following updates:

~/.composer ⮀ composer global update
Changed current directory to /Users/joshmurray/.composer
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 2 updates, 0 removals

  • Updating symfony/var-dumper (v3.4.15 => v4.1.4): Loading from cache
  • Updating tightenco/collect (v5.7.1 => v5.7.2): Downloading (100%)
    Writing lock file
    Generating autoload files

I preformed a valet install and I'm still getting this:

~/.composer ⮀ valet install
Password:
Sorry, try again.
Password:
PHP Warning: Class 'Tightenco\Collect\Support\Debug\Dumper' not found in /Users/joshmurray/.composer/vendor/laravel/valet/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18
PHP Stack trace:
PHP 1. {main}() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:0
PHP 2. require() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:8
PHP 3. ComposerAutoloaderInit13b2b43e1baf99c536dd6f91a45f1789::getLoader() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/autoload.php:7
PHP 4. composerRequire13b2b43e1baf99c536dd6f91a45f1789() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/composer/autoload_real.php:56
PHP 5. require() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/composer/autoload_real.php:66
PHP 6. class_alias() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/tightenco/collect/src/Collect/Support/alias.php:18

Warning: Class 'Tightenco\Collect\Support\Debug\Dumper' not found in /Users/joshmurray/.composer/vendor/laravel/valet/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18

Call Stack:
0.0006 447352 1. {main}() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:0
0.0026 448528 2. require('/Users/joshmurray/.composer/vendor/laravel/valet/vendor/autoload.php') /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:8
0.0037 463376 3. ComposerAutoloaderInit13b2b43e1baf99c536dd6f91a45f1789::getLoader() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/autoload.php:7
0.0194 836192 4. composerRequire13b2b43e1baf99c536dd6f91a45f1789() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/composer/autoload_real.php:56
0.0199 840144 5. require('/Users/joshmurray/.composer/vendor/laravel/valet/vendor/tightenco/collect/src/Collect/Support/alias.php') /Users/joshmurray/.composer/vendor/laravel/valet/vendor/composer/autoload_real.php:66
0.0282 1268080 6. class_alias() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/tightenco/collect/src/Collect/Support/alias.php:18

PHP Warning: Class 'Tightenco\Collect\Support\Debug\HtmlDumper' not found in /Users/joshmurray/.composer/vendor/laravel/valet/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18
PHP Stack trace:
PHP 1. {main}() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:0
PHP 2. require() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:8
PHP 3. ComposerAutoloaderInit13b2b43e1baf99c536dd6f91a45f1789::getLoader() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/autoload.php:7
PHP 4. composerRequire13b2b43e1baf99c536dd6f91a45f1789() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/composer/autoload_real.php:56
PHP 5. require() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/composer/autoload_real.php:66
PHP 6. class_alias() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/tightenco/collect/src/Collect/Support/alias.php:18

Warning: Class 'Tightenco\Collect\Support\Debug\HtmlDumper' not found in /Users/joshmurray/.composer/vendor/laravel/valet/vendor/tightenco/collect/src/Collect/Support/alias.php on line 18

Call Stack:
0.0006 447352 1. {main}() /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:0
0.0026 448528 2. require('/Users/joshmurray/.composer/vendor/laravel/valet/vendor/autoload.php') /Users/joshmurray/.composer/vendor/laravel/valet/cli/valet.php:8
0.0037 463376 3. ComposerAutoloaderInit13b2b43e1baf99c536dd6f91a45f1789::getLoader() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/autoload.php:7
0.0194 836192 4. composerRequire13b2b43e1baf99c536dd6f91a45f1789() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/composer/autoload_real.php:56
0.0199 840144 5. require('/Users/joshmurray/.composer/vendor/laravel/valet/vendor/tightenco/collect/src/Collect/Support/alias.php') /Users/joshmurray/.composer/vendor/laravel/valet/vendor/composer/autoload_real.php:66
0.0298 1268112 6. class_alias() /Users/joshmurray/.composer/vendor/laravel/valet/vendor/tightenco/collect/src/Collect/Support/alias.php:18

Stopping nginx...
Installing nginx configuration...
Installing nginx directory...
Updating PHP configuration...
Restarting php...
Restarting dnsmasq...
Restarting nginx...

Valet installed successfully!

Do you know when this will be fixed?

Thanks very much.
Josh

Hi again

I just wanted to let everyone know that this seems to be fixed now. I went to my global composer.json located in my home directory and I removed everything from there with: composer remove vendor/package. Once I had went through all of the removals, I proceeded with a quick composer dump-autoload and lastly a composer clear-cache.

I then required valet again with composer global require laravel/valet and executed valet install.

Works. Thanks @mattstauffer

Josh

Composer global update should fix it for anyone else who runs into this. Or ‘composer global update Laravel/valet’ I think.

I just ran composer global update and then valet install and getting the following error.

valet start
PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /Users/pankajagrawal/.composer/vendor/tightenco/collect/src/Collect/Support/Collection.php on line 181
PHP Stack trace:
PHP 1. {main}() /Users/pankajagrawal/.composer/vendor/laravel/valet/cli/valet.php:0
PHP 2. require() /Users/pankajagrawal/.composer/vendor/laravel/valet/cli/valet.php:10
PHP 3. ComposerAutoloaderInitf1e036c3fa08b21f654fd3b8a328d868::getLoader() /Users/pankajagrawal/.composer/vendor/autoload.php:7
PHP 4. composerRequiref1e036c3fa08b21f654fd3b8a328d868() /Users/pankajagrawal/.composer/vendor/composer/autoload_real.php:56
PHP 5. require() /Users/pankajagrawal/.composer/vendor/composer/autoload_real.php:66
PHP 6. class_alias() /Users/pankajagrawal/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php:16
PHP 7. spl_autoload_call() /Users/pankajagrawal/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php:16
PHP 8. Composer\Autoload\ClassLoader->loadClass() /Users/pankajagrawal/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php:16
PHP 9. Composer\Autoload\includeFile() /Users/pankajagrawal/.composer/vendor/composer/ClassLoader.php:322
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /Users/pankajagrawal/.composer/vendor/tightenco/collect/src/Collect/Support/Collection.php on line 181Call Stack:
0.0008 300952 1. {main}() /Users/pankajagrawal/.composer/vendor/laravel/valet/cli/valet.php:0
0.0010 302560 2. require('/Users/pankajagrawal/.composer/vendor/autoload.php') /Users/pankajagrawal/.composer/vendor/laravel/valet/cli/valet.php:10
0.0012 318440 3. ComposerAutoloaderInitf1e036c3fa08b21f654fd3b8a328d868::getLoader() /Users/pankajagrawal/.composer/vendor/autoload.php:7
0.0035 575232 4. composerRequiref1e036c3fa08b21f654fd3b8a328d868() /Users/pankajagrawal/.composer/vendor/composer/autoload_real.php:56
0.0036 579496 5. require('/Users/pankajagrawal/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php') /Users/pankajagrawal/.composer/vendor/composer/autoload_real.php:66
0.0039 587200 6. class_alias() /Users/pankajagrawal/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php:16
0.0039 587568 7. spl_autoload_call() /Users/pankajagrawal/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php:16
0.0039 587624 8. Composer\Autoload\ClassLoader->loadClass() /Users/pankajagrawal/.composer/vendor/tightenco/collect/src/Collect/Support/alias.php:16
0.0039 587792 9. Composer\Autoload\includeFile() /Users/pankajagrawal/.composer/vendor/composer/ClassLoader.php:322

@pankaj-ag wrote:

PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR)

The most often cause of that is using an old PHP version. Valet requires at least PHP 5.6. I suspect yours is older.
What does this output? php -v

@drbyte
Current php version is php 5.6.37.

PHP 5.6.37 (cli) (built: Jul 20 2018 08:26:50)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

What's in your ~/.composer/composer.json file?

I think you're using PHP7 versions of packages, but don't have PHP 7 installed.
Therefore for you forcing your global composer config to require PHP 5.6 versions of packages will be necessary until you move to a newer PHP version.

composer global config platform.php 5.6.36
composer global update

thanks @drbyte
I will try and let you know if this fix the issue.

thanks again for the help.

I'm having this error.

I tried with composer global update laravel/valet and also the steps suggested by @joshmurrayeu. Any news? 🤔

Valet version is v2.1.1

Hi @Lloople

Did you follow all of the steps I noted down or just some of them? I have tried this on multiple machines and it seems to work in every case. Please try once again (remove all of the packages, dump the autoload, clear the cache, require the package once again).

Before you remove all of your packages, I would recommend making a backup of your global composer.json file (you should always do periodic backups of these files anyway).

Please get back and let us know how you get on.

Thanks
Josh

Hi @joshmurrayeu,

Yes I followed all the steps, and I did it again in case I missed something last time.

It continues to happen, but only in a non-laravel project which have installed tightenco/collect.

Weird thing is that the erro comes from project/vendor/tightenco/collect/src/Collect/Support/helpers.php, so maybe I should open an issue in that package 🤔

@lloople you have an outdated version of Collect. Your problem has nothing to do with Valet. You need to update collect in that project.

@mattstauffer this is what composer.lock says on that project

"name": "tightenco/collect",
"version": "v5.7.6",

I think it's the last version (Installed it yesterday)

EDIT: But you gave an idea with that comment. The issue was that this project already required symfony/var-dumper, but an old version: "symfony/var-dumper": "^3.3@dev". I removed that line and run composer update and everything works now. Maybe tightenco/collect should be less flexible on var-dumper version? 🤔

@lloople if you want to discuss any further let’s move over to collect. But it is relaxed; you may have just needed to update twice (we upped and then re-lowered that exact version constraint if I remember correctly)

@drbyte your solution worked for me. Thanks.

Was this page helpful?
0 / 5 - 0 ratings