Question

My custom theme is not loading the compiled Less CSS file. In the theme layout XML, I am loading the CSS files as below in default_head_blocks.xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="css/responsive.css" />
    <css src="css/custom.css" />
    <link src="js/custom.js"/> 

</head>

then I have a custom.less file also. In my local everything is fine. But when I pushed my code to the production server and run all the setup: upgrade, indexer, static deploy commands this "custom.css" file is not loading. The files get generated in pub/static folder but CSS files are not loading in head section.

Only upto responsive.css is loading in Head section. the custom.css and custom.js are not loading.

Anyone knows what is the reason and how to solve this?

Was it helpful?

Solution

My above Issue is fixed. The solution was to change the theme type from virtual (1) to physical (0) in database "theme" table. After that flush the cache.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top