Magento 2 does not load the styles in "developer" mode

1

I have a store with Magento 2 on a server with Ubuntu 16.04 + PHP 7.0 and I do not know why when I activate the developer mode running:

php bin/magento deploy:mode:set developer

I do not load styles or JS and when I change mode executing the command:

php bin/magento setup:static-content:deploy 

Yes it works but I need to load them in developer mode so I do not have to change mode every time I make a change.

    
asked by Infobuscador 15.09.2017 в 00:35
source

1 answer

0

When Magento 2 is in developer mode, the files in the pub / static folder are not generated as in production mode, instead symbolic links are generated to the sources of these.

The entry point for the generation of such symbolic links occurs in pub / static.php and in nginx this is the rule that is responsible for such behavior:

location /static/ {
...
    if (!-f $request_filename) {
        rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
    }

There are several things to review:

  • Pub / static and pub / static.php permissions
  • Web server configuration (Nginx or Apache), see configurations suggested by Magento: link and link
  • That is "running" pub / static.php, is generally related to the previous point
answered by 15.09.2017 / 01:31
source