7

After updating to Magento 2.1.16 on my staging server with nginx server and php7.0 I am facing issue in compiling less and css files. The files styles-l.css and styles-m.css are missing - not generated.

During static contend deploy I get errors:

Compilation from source: /srv/www/rmstaging/public_html/vendor/magento/theme-frontend-blank/web/css/styles-l.less

Compilation from source: frontend/Smartwave/porto_rtl/en_US/css/styles-l.less variable @modal-popup-breakpoint-screen__m is undefined in file /srv/www/rmstaging/public_html/var/view_preprocessed/css/frontend/Smartwave/porto_rtl/en_US/Magento_Checkout/css/source/module/checkout/_tooltip.less in _tooltip.less on line 11, column 41

I tried many solution including on given in https://stackoverflow.com/questions/50764127/magento-2-less-compilation-error-while-setupstatic-contentdeploy-and-frontend given by @Ashsih Raj. But did not work either.

I had the same issue on localhost but that was fixed mysteriously. I think the only change is that on my localhost I compiles using PHP7.1

Please advise.

4
  • You can delete this file if it is not necessary Commented Dec 8, 2018 at 9:34
  • Which file should be deleted?
    – Abid Malik
    Commented Dec 8, 2018 at 15:08
  • Delete file .less you have the error Commented Dec 13, 2018 at 3:40
  • @VuTranKien Did that already but no use.
    – Abid Malik
    Commented Dec 13, 2018 at 6:33

5 Answers 5

20

For all Porto Theme users upgrading to Magento 2.3:

Edit the following files (also other language codes if available):

app/design/frontend/Smartwave/porto/Magento_Checkout/web/css/source/module/checkout/_tooltip.less
app/design/frontend/Smartwave/porto_rtl/Magento_Checkout/web/css/source/module/checkout/_tooltip.less

Replace the following piece of code, found on line 11:

@checkout-tooltip-breakpoint__screen-m: @modal-popup-breakpoint-screen__m;

with the following code:

@checkout-tooltip-breakpoint__screen-m: @screen__m;

Diff

11c11
< @checkout-tooltip-breakpoint__screen-m: @modal-popup-breakpoint-screen__m;
---
> @checkout-tooltip-breakpoint__screen-m: @screen__m;

Please note: In current versions of the Porto Theme there is a Patch included for Magento 2.3!

3
  • the correct line is like in the diff: @checkout-tooltip-breakpoint__screen-m: @screen__m; We had the en_GB version,so the error code if anyone is wondering was: report.ERROR: variable @modal-popup-breakpoint-screen__m is undefined in file [...]/var/view_preprocessed/pub/static/frontend/Smartwave/porto/en_GB/Magento_Checkout/css/source/module/checkout/_tooltip.less in _tooltip.less on line 11, column 41 Commented Mar 29, 2019 at 0:08
  • 2
    Please note: In current versions of the Porto Theme there is a Patch included for Magento 2.3! that was the most important for my Magento v.2.3.1 installation.
    – kanenas
    Commented May 16, 2019 at 15:08
  • 3
    After applying the patch, also delete the var/view_processed folder before retrying the deploy.
    – Huby
    Commented May 19, 2019 at 20:13
5

Update:

This is not a permanent fix, but to get your website back up & running,

/frontend/Smartwave/porto/Magento_Checkout/web/css/source/module/checkout

Rename _tooltip.less to _tooltip.less-removed

Remember to clear your cached files & redeploy:

rm -rf pub/static/*; rm -rf var/view_preprocessed/*; php -f bin/magento setup:static-content:deploy
3

Same issue here with magento version 2.3.1

It is Always Porto theme breaking my sites.

My advice Porto Theme there is a Patch included for Magento. The file is called Patch for Magento 2.3.x.zip This will resolve your issues. Apply this patch please and after this you should be fine again.

Step 1 download the latest Porto magento 2 theme package.

Step 2 unpack/extract all files and folders

Step 3 unpack/extract all files from the \Theme Files\Magento 2.x\Patch for Magento 2.3.1 And Above.zip if you not have done this yet **and the one that resolves your issues \Theme Files\Magento 2.x\Patch for Magento 2.3.x.zip

Upload the folder app from both patches (or the ones you did not applied) with Filezilla (or any ftp program you use) to your public_html folder or whatever magento installation folder you use.

Problem solved.

New problem from Porto Theme: Check your front end categories. Mine are not working any more after updating Porto theme but this is another issue i am working on.

1

Define @modal-popup-breakpoint-screen__m in your theme. Here is the location: Magento_Checkout/css/source/module/checkout/_tooltip.less

Here is the example how you define

6
  • tried this but did not work. I see the files css/styles-l.css and css/styles-m.css are still missing.
    – Abid Malik
    Commented Dec 8, 2018 at 17:22
  • I think you missing your less file where define all constant. Make sure that you have all less file otherwise you can't proceed with it.
    – Sohel Rana
    Commented Dec 9, 2018 at 1:38
  • Thank you for the help. I already did it and it worked a bit. But there were other sections of the theme which were broken.
    – Abid Malik
    Commented Dec 10, 2018 at 17:04
  • Thank you for the help. I already did it and it worked a bit. But there were other sections of the theme which were broken. Finally, after spending some more issue, I found that after upgrade to Magento 2.1.16 somehow the theme fallback is not working. I am using custom theme -> child of Smartwave Porto theme -> child of Magento Blank. When doing static_content deploy, the CSS from porto is not loaded especially for Checkout module. I copied the files from porto to custom theme and it worked. BUT I DON'T THINK IT IS PROPER SOLUTION. AND ONE MORE THING THE WHOLE THING IS WORKING FINE ON LCLHST
    – Abid Malik
    Commented Dec 10, 2018 at 17:09
  • I just copied files from parent theme SmartWave Porto to My Child theme and things worked. But I need more robust solution.
    – Abid Malik
    Commented Dec 30, 2018 at 8:44
0

For myself, I was getting:

Compilation from source: vendor/magento/theme-frontend-blank/web/css/styles-m.less Unable to get content for 'frontend/Magento/blank/en_AU/css/source/components/_modals.less'

Quick Fix

I found removing the vendor then re-installing:

rm -rf vendor/
composer -n install

Immediately solved the issue when running php bin/magento setup:static-content:deploy, but then it would fail once again after the first deploy.

Permanent Fix

Searching for this file in vendor helped me

find . -type f -name "_modals.less" | grep -i "source/components"

./vendor/magento/magento2-base/lib/web/css/source/components/_modals.less
./lib/web/css/source/components/_modals.less

These 2 files were identical for me

Copying one of these files into my theme directory resolved these for future deploys:

mkdir -p ./app/design/frontend/<MY_VENDOR>/<MY_THEME>/web/css/source/components
cp  ./vendor/magento/magento2-base/lib/web/css/source/components/_modals.less ./app/design/frontend/<MY_VENDOR>/<MY_THEME>/web/css/source/components/_modals.less

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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