Skip to content

Server Side Compiler doesn't import some remote CSS files #25119

Closed
@viniciusfabri

Description

@viniciusfabri

Preconditions (*)

  1. Blank Magento 2.3.2, 2.3-develop with a custom theme(or just Luma)
  2. Server side compiling enabled
  3. PHP 7.1.26 & 7.2

Steps to reproduce (*)

  1. On a .less file, import the following URL, according to the documentation:
    @import url("https://fonts.googleapis.com/icon?family=Material+Icons");
  2. Clear pub/static/*
  3. Run bin/magento setup:static-content:deploy -f

Expected result (*)

  1. The LESS code should be compiled successfully

Actual result (*)

  1. You get the following error:
    [2019-10-17 11:21:16] report.ERROR: File https://fonts.googleapis.com/icon not found. in styles-l.less [] []
    image

Root cause

We were able to track down the issue down to the less.php library. This URL doesn't work because it doesn't have the "css" word in it, which the library takes into account when importing css files: https://github.com/wikimedia/less.php/blob/master/lib/Less/Tree/Import.php#L44

Not sure how we can fix this in Magento (the library project doesn't have an issue queue), so maybe we can update the documentation instead?

I couldn't find a similar ticket to this, but maybe it's a duplicate. If so feel free to close

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CssIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPartner: YouweProgress: doneReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions