Good day to All,
I'm stuck with some issues and really don't know how to get out of these errors.
First I wanted to get my store out of production mode, unfortunately there is no way to get into dev or default mode. While using the commando 'bin/magento deploy:mode:set developer' or 'bin/magento deploy:mode:set default' I'm getting a error:
Fatal error: Uncaught TypeError: Argument 4 passed to Magento\Developer\Model\View\Asset\PreProcessor\FrontendCompilation::processContent() must be an instance of Magento\Framework\View\Asset\File\FallbackContext, instance of Magento\Framework\View\Asset\File\Context given, called in /data/web/magento2/vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php on line 90 and defined in /data/web/magento2/vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php:107 Stack trace: #0 /data/web/magento2/vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php(90): Magento\Developer\Model\View\Asset\PreProcessor\FrontendCompilation->processContent('1bb602f6cdc86e9...', '@import 'source...', '', Object(Magento\Framework\View\Asset\File\Context)) #1 /data/web/magento2/vendor/magento/module-developer/Model/View/Asset/PreProcessor/PreprocessorStrategy.php(74): Magento\Developer\Model\View\Asset\PreProcessor\FrontendCompilation->process(Object(Magen in /data/web/magento2/vendor/magento/module-developer/Model/View/Asset/PreProcessor/FrontendCompilation.php on line 107
I thought as the minifications are set this could causing an error, but I cannot change these due to the error trying to get out of production mode
(this all accured while trying to update magento 2.2.5 to 2.2.6 and had to role back due to error's I could not solve)
then also the cache files are gone when trying to remove var/di and var/gen I found out the cache files have changed to file 'generated'
so for now it feels like I'm trapped in a circle and cannot finf the way out....
for the start my main question is : how do I get out of 'production mode'?
Thank you in advance for your time hopefully someone is willing an able to get me out of this circle
Solved! Go to Solution.
Your error may indicate that something has been minified or merged or compiled for client side. Run php bin/magento deploy:mode:set development.
Clear all caches and if you still get this error, go to the database to the core_config_data table and look for client_side_compilation.
Find the path "dev/front_end_development_workflow/type" and if the value is "client_side_compilation" then change it to "server_side_compilation". Clear all caches again and run rm -rf var/cache/*
It should work fine after that. I'm not sure what causes the error. Probably some sort of caching mechanism that isn't cleared correctly.
Your error may indicate that something has been minified or merged or compiled for client side. Run php bin/magento deploy:mode:set development.
Clear all caches and if you still get this error, go to the database to the core_config_data table and look for client_side_compilation.
Find the path "dev/front_end_development_workflow/type" and if the value is "client_side_compilation" then change it to "server_side_compilation". Clear all caches again and run rm -rf var/cache/*
It should work fine after that. I'm not sure what causes the error. Probably some sort of caching mechanism that isn't cleared correctly.
Hi @SolsWebdesign,
Thank you so much for your solution!
Finally I'm able to switch without any problems to default/developer and production mode.
best regards,