0

I'm trying to switch to client-side compilation in Configuration->Advanced->Developer->Frontend Development Workflow however the option is disabled and I cant' select it. It says

not available in production mode

however I'm in developer mode from what I can see.

  • in app/etc/env.php I have

'MAGE_MODE' => 'developer',

  • in php bin/magento deploy:mode:show the result is

Current application mode: developer.

  • in .htaccess there is the line

SetEnv MAGE_MODE developer

  • I've cleaned generated/code directory
  • I've ran php bin/magento cache:clean
  • I've set ownership/permissions to all folders and files

Any ideas what else I can try?

After further troubleshooting I can see in vendor/magento/module-developer/Block/Adminhtml/System/Config/WorkflowType.php

if ($this->_appState->getMode() == \Magento\Framework\App\State::MODE_PRODUCTION) 

returns false so I'm definitely NOT in production mode and parent::render() is called.

Afterwards in vendor/magento/module-config/Block/System/Config/Form/Field.php

I can see $isCheckboxRequired is true and $element->getInherit() returns 1 so the field is disabled.

public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
{
    $isCheckboxRequired = $this->_isInheritCheckboxRequired($element);

    // Disable element if value is inherited from other scope. Flag has to be set before the value is rendered.
    if ($element->getInherit() == 1 && $isCheckboxRequired) {
        $element->setDisabled(true);
}

However I can't see from the field definition in system.xml why this field is impossible to edit for me.

4
  • Have you tried running bin/magento deploy:mode:set developer – harri Dec 10 '17 at 12:01
  • Yes I did, I also cleared the following folders var/cache, generated/metadata, generated/code, var/view_preprocessed, pub/static – gabtzi Dec 10 '17 at 12:02
  • hmm I not sure could it be set in the apache config file? /etc/apache2/sites-available/mage2.conf or something? – harri Dec 10 '17 at 12:04
  • I checked all files related to configuration apache/nginx and there is no reference to the MAGE_MODE variable. I did add some troubleshooting info after stepping in through the code though. – gabtzi Dec 10 '17 at 12:28
0

If this setting is disabled, this value was most likely hard-coded in the app/etc/config.php file. Look for the lines:

'front_end_development_workflow' => [
    'type' => 'server_side_compilation'
],

and remove them from the file.

You'll then need to import the new configuration by running:

bin/magento app:config:import

After reloading the page, the setting should no longer be disabled.

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.