Magento – Magento Developer mode not working – still trying to load pub/static

developer-modemagento2static-content

Enabling developer mode in magento is giving some errors for me, it is still trying to load all my static content. Ive disabled the "sign static content" option.

Also, when I put my Magento environment in production mode, the fonts in my design/frontend/vendor/theme/web/fonts folder are not moved to the static content.

Any thoughts?

Best Answer

When running in developer mode, files will still be loading from the pub/static folder. The difference is that some magic in the pub/static/.htaccess file routes the request to the pub/static.php file, which generates symlinks to populate the pub/static directories with your files, on demand. So, one possible way to fix developer mode is:

  1. If you are running Apache, make sure you didn't delete pub/static/.htaccess, and make sure Apache is configured to use .htaccess files.
  2. If you are running Nginx, make sure the site configuration is correct also. You can look at the nginx.conf.sample file for examples of how to set up the /static/ rewrite.

I'm not sure about what's going on with the fonts in production mode if running bin/magento setup:static-content:deploy isn't moving them.

Maybe try to clear all your caches, then run setup:static-content:deploy again:

  1. bin/magento cache:clean
  2. rm -r var/view_preprocessed/*
  3. rm -r var/page_cache/*
  4. rm -r pub/static/*