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.

Home Page:http://www.magento.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Issue] Static content deploy - Type error

Nuranto opened this issue · comments

Preconditions and environment

  • Magento version 2.4.7

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

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

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:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

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

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)

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.

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

✅ 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.

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

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

any Updates ?