1

Background:

I seem to be having trouble disabling modules on my M2 2.3.1 store. Example: I had installed the CommerceBug development module but wanted to test my site without it so I ran module:disable Company_Commercebug.

Magento reported that the module was disabled. (I then ran the usual setup:upgrade, deleted all cache/generated/static directories and cleared all redis caches), but I found that the module was still outputting its CSS and JS files via the frontend.

This behaviour only stopped when I uninstalled the module using module:uninstall.

There is a good explanation of what module:uninstall does in the Magento Dev Docs but there is not an equivalent explanation for module:disable.

So what does module:disable actually do? Is it meant to prevent CSS/JS/etc. from being included? How does it differ from "Disable module output" in the admin panel?

1

When you run php bin/magento module:disable Company_Commercebug, It will disable the module in app/etc/config.php

<?php
return [
  ...
    'Company_Commercebug' => 0,
  ...
    ]
];

So once your extension will be disabled, you need to remove it's statis using below process:

Remove following :

pub/static - Do not delete .htaccess
var/cache
var/composer_home
var/page_cache
var/view_preprocessed
generation/

Now run: php bin/magento setup:static-content:deploy using -f if you are in developer mode.

Alternativally, you can also use below command, it will create it's static content:

php bin/magento module:disable Company_Commercebug --clear-static-content

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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