magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.3k stars 9.27k forks source link

[Issue] Static content deploy - Type error #38682

Open Nuranto opened 2 weeks ago

Nuranto commented 2 weeks ago

Preconditions and environment

Steps to reproduce

  1. Create an empty less file in your theme
  2. Launch setup:static-content:deploy --force

Expected result

The error "LESS file is empty" is displayed correctly

Actual result

 Magento\Framework\Exception\LocalizedException::__construct(): Argument #1 ($phrase) must be of type Magento\Framework\Phrase, string given, called in /var/www/html/vendor/magento/module-deploy/Service/DeployPackage.php on line 142

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 2 weeks ago

Hi @Nuranto. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 2 weeks ago

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Delta commented 2 weeks ago

Hi @Nuranto ,

Thanks for reporting and collaboration.

Verified the issue in Magento 2.4 dev instance and 2.4.7 and the issue is not reproducible.

Steps to reproduce:

1.Create an empty less file in your theme 2.Launch setup:static-content:deploy --force

Please refer the attached screenshots, data and let us know if we missed anything.

Created an empty less file in luma theme abc.less

Screenshot 2024-05-02 at 8 03 43 PM

bin/magento setup:static-content:deploy --force , it's ran successfully

Screenshot 2024-05-02 at 8 04 46 PM
Nuranto commented 2 weeks ago

Rename _abc.less to abc.less, and you should be able to reproduce the issue. (The goal here is just to generate an error during compilation. You can use another method for that if you want. The issue is about an error that happens when an error is displayed)

engcom-Delta commented 2 weeks ago

Hi @Nuranto,

Verified the issue on 2.4-develop, 2.4.7 and it is reproducible.

Hence, Confirming the issue.

Steps to reproduce:-

1.Create an empty less file in your theme 2.Launch setup:static-content:deploy --force

Screenshot 2024-05-02 at 9 53 54 PM Screenshot 2024-05-02 at 10 08 20 PM

Please refer the attached screenshot.

github-jira-sync-bot commented 2 weeks ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-11905 is successfully created for this GitHub issue.

m2-assistant[bot] commented 2 weeks ago

:white_check_mark: Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

mrtuvn commented 1 week ago

seem you need use file less with underscore for solve problem. Magento not allow you import styles without underscore I'm not sure but seem problem related with php version and lessphp compiler package may not fully compatible with new php Magento used this one "wikimedia/less.php" for gen styles by php

Kishorchhugani commented 5 days ago

my less file not empty still giving me same error after upgrading to 2.4.7 in deploy command !!!

any Updates ?