0

I am running Magento 2 locally in developer mode

After installing i would not expect to have to run setup:static-content:deploy if in developer mode.

However, the only directory under static is _requirejs and all css and other assets generate a 404 on the frontend.

Is the setup:static-content:deploy command required even in developer mode or do i have an issue with this?

3

If you are in Apache:

  1. Check you have the correct .htaccess file under pub/static folder https://github.com/magento/magento2/blob/2.2/pub/static/.htaccess. Check https://github.com/magento/magento2/blob/2.2/pub/static/.htaccess#L21 which redirects requests to static.php
  2. Make sure your mod rewrite module is working properly.
  3. Make sure apache is reading .htaccess files.

Apache 2.2 AllowOverride All Order allow,deny Allow from all

Apache 2.4 AllowOverride All Require all granted

If you are in Nginx:

Update configurations using https://github.com/magento/magento2/blob/2.2/nginx.conf.sample. Check https://github.com/magento/magento2/blob/2.2/nginx.conf.sample#L111 which redirects requests to static.php

1

Also, if you are running Apache: make sure that mod_rewrite module is enabled.

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.