0

I have installed dev enviroments for magento 2 based in configuration beta provides
But js not load even i already have setup permissions and installed sampledata
Anyone know how to fix it?
Running in ubuntu 16.10 with docker 1.13.0 MagentoCE2.1.3
enter image description here


Frontend enter image description here

mrtuvn
  • 3,273
  • 5
  • 28
  • 39
  • if static generation not work... could you provide what link do you followed to create docker container? it caused due to various reasons like wrong port expose, wrong base url. could you check base url from database and check the same will be present as the root path of all the css&js in page source. – Bilal Usean Feb 03 '17 at 05:03
  • I got configuration based in macos but run in ubuntu – mrtuvn Feb 03 '17 at 05:57

3 Answers3

2

The issue is occur because after install magento 2 you haven't deploy its static content. So magento 2 unable to find your css and js. Try run below command in same sequence :

To resolve this issue run below commands :

  1. php bin/magento deploy:mode:set developer (set the mode of environment is developer)
  2. php bin/magento setup:di:compile(it will generate all the proxies and dependencies )
  3. php bin/magento setup:static-content:delpoy(it will deploy all the static content)
  4. php bin/magento cache:clean and php bin/magento cache:flush(clear the cache) It will resolve the issue.

Also check permission of you var/generation directory it should be 770 or 755

Also for more refernce check this link - No images or JS on new Magento 2 installation

Manthan Dave
  • 9,816
  • 2
  • 31
  • 53
0

Can you clear your cache and reploy your static contents? You can use the following commands and run it from your Magento install directory /var/www/magento2:

php bin/magento cache:flush
php bin/magento setup:static-content:deploy
0

You need to deploy the static files, clean cache, upgrade the setup on database, reindex and give the right permission on folders, so do that:

alias mage="php -d memory_limit=-1 -f bin/magento"
mage deploy:mode:set developer ; 
chmod -R 777 pub/static/ var/ pub/media/ &&
rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/ ;
mage cache:clean &
mage cache:flush &
mage indexer:reindex &
mage setup:upgrade &&
mage setup:static-content:deploy ; mage setup:static-content:deploy -f;
mage setup:db-data:upgrade &&
mage dev:source-theme:deploy &&
chmod -R 777 pub/static/ pub/media/ var/

Maybe will be necessary give the permission to the folders out of the docker container.

Rafael Corrêa Gomes
  • 13,309
  • 14
  • 84
  • 171