Magento 2 Compile Issue "No tokens were provided"

Magento 2 Compile Issue "No tokens were provided"

If you run the command:

bin/magento setup:di:compile


and run into this error:

No tokens were provided


this may be your solution:


Seems you have an empty file somewhere which gets parsed by the \Magento\Setup\Module\Di\Code\Reader\ClassesScanner. The class uses the PHP token_get_all() method (in some Zend components). The exception is thrown, if the method does not return any value, which is the case of an empty file. Check your own code or your third party modules for emtpy files with this command:

find /path/to/dest -type f -empty


Remove the files, and the compilation should succeed.



Tags: , , ,

Eintrag von Florian Horn am 23.03.2016

comments powered by Disqus