Unable to deploy static content in Magento 2.0

Unable to deploy static content in Magento 2.0

September 1, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Unable to deploy static content in Magento 2.0

Debugging Static Content Deployment Errors in Magento 2

Deploying static content is a crucial step in maintaining a secure and optimized Magento 2 storefront. However, you’ve encountered an error during the deployment process:

$ php bin/magento setup:static-content:deploy -f

The error log indicates that there’s an issue with less compilation for a third-party theme extension:

[Magento\Framework\View\Asset\ContentProcessorException]
  Compilation from source:
  frontend/Smartwave/porto/en_US/css/styles-m.less
  ._lib-popup-button-close-icon is undefined in /var/www/html/var/view_preprocessed/css/frontend/Smartwave/porto/en_US/css/source/_popups.less

This error suggests that the less compiler cannot find a defined variable or mixin within the _popups.less file for the Porto theme.

Understanding the Error Context

The error message points to a specific line in the _popups.less file, indicating that an undefined symbol .lib-popup-button-close-icon is being used. This typically happens when:

  1. There’s a typo or missing definition in the less file.
  2. The required library or theme component is not properly loaded before this file.

Troubleshooting Steps

1. Verify Theme Compatibility and Version

Ensure that your Magento version is compatible with the installed Porto theme extension. Incompatible versions can lead to missing definitions and errors during compilation.

Check the app/etc/config.php file for the current theme implementation:

[Smartwave_Porto]
active=true
code=Smartwave_Porto
area=frontend
path=vendor/smartwave/porto

2. Check Theme Customizations

If you’ve made custom changes to the Porto theme, especially in the less files, ensure that all required definitions are properly included or defined before using them.

3. Inspect the Less File Structure

Navigate to the theme’s less directory and check if the .lib-popup-button-close-icon variable is defined somewhere else:

cd app/design/frontend/Smartwave/Porto/web/css/source/

Look for the definition or import statement in other source files, like a default.less file.

4. Rebuild Theme Compilation

Sometimes, the compiler cache can cause issues. You can try clearing and rebuilding the static content:

php bin/magento setup:static-content:deploy --theme Magento/luma -f

Replace Magento/luma with your current theme if needed.

Best Practices for Static Content Deployment

To avoid such errors in the future, follow these best practices:

  • Always keep your Magento and themes up to date.
  • Avoid making direct changes to core or third-party theme files. Instead, use child themes or override rules.
  • Regularly clear and rebuild static content after making significant code changes.

Conclusion: Resolving Static Content Deployment Issues

The error you encountered typically resolves by ensuring the proper loading of theme components or correcting customizations in the less files. If the issue persists, consider reaching out to the theme vendor’s support for further assistance with their specific extension.

Remember, Magento 2 has built-in tools like the setup:static-content:deploy command and the view preprocessor error logs to help you identify and resolve such issues efficiently.

For more in-depth guides on Magento development best practices and troubleshooting techniques, visit our dedicated resources at Laravel Company.

Magento 2 Performance Extensions Themes

Our network