0

I am running Magento 2. And my Magento admin is missing CSS also the below error is shown while compiling .

syntax error, unexpected '?' in /home/username/public_html/store/vendor/magento/module-store/App/Config/Source/InitialConfigSource.php on line 72

Admin Css hosted in below url

/store/pub/static/adminhtml/Magento/backend/en_US/css/styles.css

is showing this error

Compilation from source: 
adminhtml/Magento/backend/en_US/css/styles.less
variable @icon-external-link__content is undefined in file /home/username/public_html/store/var/view_preprocessed/css/adminhtml/Magento/backend/en_US/Magento_Analytics/css/source/_module.less in _module.less on line 59, column 14
57|   &:after {
58|     &:extend(.abs-icon all);
59|     content: @icon-external-link__content;
60|     font-size: @font-size__xs;
61|     vertical-align: super;
62|   }
#0 /home/username/public_html/store/vendor/magento/framework/View/Asset/PreProcessor/AlternativeSource.php(155): 
Magento\Framework\Css\PreProcessor\Adapter\Less\Processor->processContent(Object(Magento\Framework\View\Asset\File))
#1 /home/username/public_html/store/vendor/magento/framework/View/Asset/PreProcessor/AlternativeSource.php(115): 
Magento\Framework\View\Asset\PreProcessor\AlternativeSource->processContent('css/styles.css', '', '', 
Object(Magento\Framework\View\Asset\File\FallbackContext))
#2 /home/username/public_html/store/vendor/magento/module-developer/Model/View/Asset/PreProcessor/PreprocessorStrategy.php(62): 
Magento\Framework\View\Asset\PreProcessor\AlternativeSource->process(Object(Magento\Framework\View\Asset\PreProcessor\Chain))
#3 /home/username/public_html/store/vendor/magento/framework/View/Asset/PreProcessor/Pool.php(74): 
Magento\Developer\Model\View\Asset\PreProcessor\PreprocessorStrategy->process(Object(Magento\Framework\View\Asset\PreProcessor\Chain))
#4 /home/username/public_html/store/vendor/magento/framework/View/Asset/Source.php(152): Magento\Framework\View\Asset\PreProcessor\Pool->process(Object(Magento\Framework\View\Asset\PreProcessor\Chain))
#5 /home/username/public_html/store/vendor/magento/framework/View/Asset/Source.php(105): Magento\Framework\View\Asset\Source->preProcess(Object(Magento\Framework\View\Asset\File))
#6 /home/username/public_html/store/vendor/magento/framework/View/Asset/File.php(150): Magento\Framework\View\Asset\Source->getFile(Object(Magento\Framework\View\Asset\File))
#7 /home/username/public_html/store/vendor/magento/framework/App/StaticResource.php(97): Magento\Framework\View\Asset\File->getSourceFile()
#8 /home/username/public_html/store/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\StaticResource->launch()
#9 /home/username/public_html/store/pub/static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))
#10 {main}

After i had updated my php to 7.0. The below issue is shown on compile.

Fatal error: Declaration of Magento\Sales\Model\Order\Shipment\ItemRepository::getList(Magento\Framework\Api\SearchCriteriaInterface $searchCriteria) must be compatible with Magento\Sales\Api\ShipmentItemRepositoryInterface::getList(Magento\Framework\Api\SearchCriteria $searchCriteria) in /home/gs/public_html/store/vendor/magento/module-sales/Model/Order/Shipment/ItemRepository.php on line 18

Right after the above error, i thought of updating my magento to 2.1.12 ( current version) and the composer shows the below error right after showing Generatng auto lock file

Warning: Ambiguous class resolution, "PHPUnit_Framework_MockObject_Generator" was found in both "/home/username/public_html/store/vendor/phpunit/phpunit-mock-objects/src//Framework/MockObject/Generator.php" and "/home/username/public_html/store/vendor/phpunit/phpunit-mock-objects/src//Generator.php", the first will be used.

Warning: Ambiguous class resolution, "PHPUnit_Framework_MockObject_Invocation" was found in both "/home/username/public_html/store/vendor/phpunit/phpunit-mock-objects/src//Framework/MockObject/Invocation.php" and "/home/username/public_html/store/vendor/phpunit/phpunit-mock-objects/src//Invocation.php", the first will be used.

  • in developer mode.. No issues . Only on production mode – Yasim Sha Apr 8 '18 at 18:11
  • Bad formatting perhaps? Developer mode is on the fly no compilation – Timothy Frew Apr 8 '18 at 19:43
  • i rise a magento issue github.com/magento/magento2/issues/14591 follow this and update your feedback – Kanhaiya lal Apr 8 '18 at 20:05
  • @Kanhaiyalal for opening a ticket on the same. And that was helpful. Also TimothyFrew for pointing out – Yasim Sha Apr 9 '18 at 5:10
1

You might using PHP 5.x version

and the given line syntax error, unexpected '?' because this is a new feature introduce in php 7 more info find http://php.net/manual/en/migration70.new-features.php

and respective css error might be came because of first error.

So better install magento 2 in php 7.x version and try if any concern are still there feel free to reply.

  • After i had fixed the above php issue i am getting the below error. Fatal error: Declaration of Magento\Sales\Model\Order\Shipment\ItemRepository::getList(Magento\Framework\Api\SearchCriteriaInterface $searchCriteria) must be compatible with Magento\Sales\Api\ShipmentItemRepositoryInterface::getList(Magento\Framework\Api\SearchCriteria $searchCriteria) in /home/username/public_html/store/vendor/magento/module-sales/Model/Order/Shipment/ItemRepository.php on line 18 – Yasim Sha Apr 9 '18 at 5:17
  • You'd better create a new question for that new error – Raul Sanchez Apr 9 '18 at 6:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.