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.56k stars 9.32k forks source link

Less compilation fails when referencing an relative path #22627

Open dverkade opened 5 years ago

dverkade commented 5 years ago

Preconditions

  1. Magento version 2.3.x & 2.3-develop

Steps to reproduce

  1. Add a reference to a lib source file in the theme(e.g. Luma) less files, such as: @import "../../../../../../../lib/web/css/source/lib/_responsive.less";
  2. Try to compile the less with the following command: php -f bin/magento -- setup:static-content:deploy -f --jobs 1 en_US -t Magento/luma

Expected result

  1. Less files are compiling because the importing a reference to a file which exists.

Actual result

Compilation from source: /var/www/html/magento2/app/design/frontend/Magento/blank/web/css/styles-l.less
Path "../../../../../lib/web/css/source/lib/_responsive.less" cannot be used with directory "/var/www/html/magento2/app/design/frontend/Magento/luma/web/i18n/enfrontend/Magento/blank/en_US                                
m2-assistant[bot] commented 5 years ago

Hi @dverkade. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@dverkade do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

dverkade commented 5 years ago

As a workaround I have changed this: @import "../../../../../../../lib/web/css/source/lib/_responsive.less"; Into this: @import "source/lib/_responsive.less"; To make it work again.

m2-assistant[bot] commented 5 years ago

Hi @engcom-Charlie. 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:

magento-engcom-team commented 5 years ago

:white_check_mark: Confirmed by @engcom-Charlie Thank you for verifying the issue. Based on the provided information internal tickets MC-22680 were created

Issue Available: @engcom-Charlie, 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 4 years ago

@dverkade why do you need re-import that file ? It's already included in styles of magento theme isn't it ? Magento already automatic find less in web/css so you don't need more specific path

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

dverkade commented 3 years ago

Issues tagged "Confirmed" and "Ready for dev" should not be closed automatically. Posting a comment here to keep the issue active.

mrtuvn commented 3 years ago

By the way seem you import incorrect way

Not use this @import "../../../../../../../lib/web/css/source/lib/_responsive.less";

Use this instead @import '../../css/source/lib/_lib-file.less'

By the way why need re-import lib responsive when it's already included before ? Current magento import lib here (include less in lib folder) https://github.com/magento/magento2/blob/2.4-develop/app/design/frontend/Magento/blank/web/css/_styles.less#L6 _responsive.less https://github.com/magento/magento2/blob/2.4-develop/app/design/frontend/Magento/blank/web/css/styles-l.less#L29

dverkade commented 3 years ago

@mrtuvn relative file paths should work. This is a confirmed issue by Magento so there's not need to discuss the validity of the issue.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions!

dverkade commented 3 years ago

Open issues should not be closed automatically.

magento-engcom-team commented 3 years ago

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.

Please feel free to comment or reopen according to the Issue reporting guidelines the ticket if you are still facing this issue on the latest 2.x-develop branch. Thank you for collaboration.

magento-engcom-team commented 3 years ago

:white_check_mark: Confirmed by @mrtuvn Thank you for verifying the issue. Based on the provided information internal tickets MC-25105 were created

Issue Available: @mrtuvn, 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 3 years ago

https://github.com/wikimedia/less.php/pull/13 Maybe lessphp lib not support relative path import yet! Let's spend time for investigate this case

suyogsourav commented 2 days ago

anyone know about the issue