7 Comments

Merged JS and CSS do not work when Production mode

Select Release_lock(?) error while reindexing - magento 1.9
Update static blocks programatically > throws error

I was in developer mode, everything was great, when I changed to Production mode, the Merged options of CSS and JS seems to be ignored, it was back listing all css and js.

Also The product page only shows the pictures of the product in developer mode, also changing to production mode it disappear.

Any thought to help me?


The point is, I’m doing it.

Here is what I did in sequence:

bin/magento setup:upgrade

bin/magento indexer:reindex

bin/magento setup:static-content:deploy

bin/magento setup:di:compile

bin/magento deploy:mode:set production

bin/magento setup:static-content:deploy

And before even start, the Merge options are YES and I was in developer mode.

Related Posts

  • Magento 2 speed issues [closed] (1)
    I have migrate Magento 1.7.x to magento 2.0.7 . In production mode also magento 2 as slow as in developer mode. I have aslo enable cache and merge css and js. Till speed is slow give me batter way to speed magento 2.
  • minify css and js file (0)
    i am able to merge css and js file from magento backend,now i want to minfiy css and js file as this feature does not minify css and js file what to do to fix it i thought some of below steps 1: it generates links like absdskdkd.css and something like adiej.js now should i minify […]
  • add to cart product with custom options on product list page (0)
    I want to show custom options on list.phtml that are on multiple select mode and when I click add to cart I want that magento doesnt redirect me to page product : I want to choose my custom options on product list and add to cart my chosen product without product page that i should […]
  • add to cart product with custom options on product list page (0)
    I want to show custom options on list.phtml that are on multiple select mode and when I click add to cart I want that magento doesnt redirect me to page product : I want to choose my custom options on product list and add to cart my chosen product without product page that i should […]
  • Magento 2 setup:upgrade to update modules breaks layout and have to redeploy (2)
    Many guides I read state just running setup:upgrade or clearing the cache will result in changes to modules being made apparent, but if I just clear the cache it doesn't help, even if I delete all the files in the var/generation and var/page_cache and var/di and var/cache folders and […]
  • Magento 2 setup:upgrade to update modules breaks layout and have to redeploy (2)
    Many guides I read state just running setup:upgrade or clearing the cache will result in changes to modules being made apparent, but if I just clear the cache it doesn't help, even if I delete all the files in the var/generation and var/page_cache and var/di and var/cache folders and […]
  • Magento 2 setup:upgrade to update modules breaks layout and have to redeploy (2)
    Many guides I read state just running setup:upgrade or clearing the cache will result in changes to modules being made apparent, but if I just clear the cache it doesn't help, even if I delete all the files in the var/generation and var/page_cache and var/di and var/cache folders and […]
  • magento2 still serves files from root/pub/ directory even in dev mode (1)
    App mode is developer (checked also in env file). Nginx has root www/. www/index.php is hit. Placed a die() statement in www/pub/index.php to make sure that the file isn't hit. It is not hit. But if I look into page source, css and js are still served from pub folder. In admin I […]
  • Varnish for high performance (0)
    I have below configuration set in varnish.params file. DAEMON_OPTS="-a :80 -f /etc/varnish/default.vcl -T 127.0.0.1:6082 -p feature=+esi_ignore_https -p cli_buffer=16384 -p feature=+esi_ignore_other_elements -p http_resp_hdr_len=64000 -P /var/run/varnish.pid -t 120 -u varnish -g […]
  • JS and CSS merged Issue in magento2 (2)
    i tried below step to merge and minify js and css bin/magento setup:upgrade bin/magento indexer:reindex bin/magento deploy:mode:set production -s php bin/magento setup:di:compile-multi-tenant bin/magento setup:static-content:deploy when i open the website in browser along […]
Select Release_lock(?) error while reindexing - magento 1.9
Update static blocks programatically > throws error

7 Comments on this article

  • User November 12, 2016

    I just did the following and the problem was solved.

    bin/magento setup:upgrade
    
    bin/magento indexer:reindex
    
    bin/magento deploy:mode:set production -s
    
    bin/magento setup:di:compile (Here was the secret, to run the di:compile after production)
    
    bin/magento setup:static-content:deploy
    

    Reply

  • User November 12, 2016

    Have you tried to flush the JavaScript/CSS? You can do this under System>Cache Management and then press the button which is on the bottom of the table on the left ‘Flus JavaScript/CSS Cache’

    Reply

  • User November 12, 2016

    You need to redeploy static after enabling this option in production mode.

    Reply

  • User November 12, 2016

    I have the similar issue. The cause for no image is because there is an error in JS file after minify JS. You can verify it in your browser (firebug etc).

    …/div>’;return __p};})(window,document,location,typeof
    jQuery!==’undefined’&&jQu

    I solved this by remove all the file in var/cache/ and pub/static/ and setup:static-content:deploy again

    But there is still another issue, it’s about the braintree if you enable it. Braintree doesn’t show up due to another JS error.

    Error: Script error for:
    https://js.braintreegateway.com/v2/braintree.js
    http://requirejs.org/docs/errors.html#scripterror

    …Error(id,msg,err,requireModules){var e=new
    Error(msg+’nhttp://requirejs.org/doc…

    For now, I simply don’t use the minify js function to avoid the trouble until solution is found.

    Reply

  • User November 12, 2016

    please also enable “Enable JavaScript Bundling” option

    store->configuration->advanced->developer->javascript setting->

    Enable JavaScript Bundling set to “yes”

    and flus cache

    I hope it’s help you

    Reply

  • User November 12, 2016

    Make sure you check your NGINX configuration file as well.

    If there is a variable $MAGE_MODE set there it needs to be changed to production as well, and save the file

    After that you will need to reload or restart NGINX depending on your preference.

    sudo service nginx reload
    

    OR

    sudo service nginx restart
    

    After that check your app/etc/env.php and see if the MAGE_MODE array key is set to production as well if not change it to production or you can use the command

    php bin/magento deploy:mode:set production
    

    After you executed the command check if the value changed app/etc/env.php, sometimes there might be permission issues.

    Next, clean out the pub/static folder.

    rm -rf pub/static/*
    

    Clear/Flush your cache

    php bin/magento cache:clean
    php bin/magento cache:flush 
    

    Now you are ready to execute the static content deploy

    php bin/magento setup:static-content:deploy
    

    Hope this helps.

    Reply

  • User November 12, 2016

    Delete cache manually var/cache and delete session manually var/session

    Reply

Add a comment

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax