Rate this post

Magento 2 uses setup:di:compile to generate all source code var/generation folder. It increases speed of magento 2 website (production mode). In developing an extension we can get bug with setup:di:compile command: No tokens were provided error and nothing description. How to fix it? This topic will give you some solutions

  • Solution 1: Check all xml file of your extension
  • Solution 1: Check empty files in your extension

Solution 1: Check all xml file of your extension

Maybe your extension has a incorrect xml file. It mean that, you have to check syntax of each xml files in your extension. If there is any issues, please fix it then open terminal and try again: php bin/magento setup:di:compile

Solution 2: Check empty files in your extension

  • The second, maybe your extension has an empty file, some file you want to use in the past but finally you forgot it.
  • Please find all empty file in your extension then delete them.
  • You can use this command line to find them:

cd  /your_extension_directory

find * -type f -empty

Result Example:

Controller/Adminhtml/Order/PrintSummary.php

i18n/en_US.csv

…..

The Relationship between Order, Shipment and Package in Magento 2
Magento 2 – Debug in Command Line Mode