Magento2: Every time needs to run static content deploy

Created on 16 Aug 2017  Â·  7Comments  Â·  Source: magento/magento2

I am using Magneto v2.1.7. Why I have to run setup:static-conent:deploy after every setup:upgrade. Otherwise no CSS or JS works.

Preconditions


  1. Magneto v2.1.7
  2. PHP v7, Mysql 5.6

Steps to reproduce

  1. Intsalll any new module
  2. Run setup:upgrade

Expected result

  1. All CSS and JS should work in admin and frontend

Actual result

  1. No CSS, JS works, all the icons converts to small rectangle

Format is valid non-issue

Most helpful comment

All 7 comments

Because you are the dumb who never ever tried to read the documentation carefully before creating a new question.

@devgoku Adding on to what @convenient said – try posting questions/problems like this on the Magento Stack Exchange first.

The reason is, is that your post isn't a bug, but rather a user error. Sometimes it's hard to tell when it's you or the software, but here is a tip that I find often works for me:

  1. Start by Googling your problem to see what other devs have to say about it and have done to remedy it.
  2. If you find answers with something along the lines of "this is a bug.", come and search here on GitHub to see if anyone else has reported it. If not, create a new issue. If it does exist, add to the discussion with what you know about the issue.
  3. If you find answers with something like "here is what you can do to correct your issue", you know that it was a user error, and not a bug in the software.

@holy-donkey hey donkey....easy pal. I know your name pushed you to use such kind of words.

@convenient . I am running in development mode.

Setup:upgrade removes some folders, a couple in var/ and pub/static. Basically a hardcore cache clear. I've noticed that whenever I've used this command, i have to make sure permissions are set correctly to recreate those folders that were deleted.

I would check permissions on those directories and see whats going on in those folders after you run setup:upgrade vs what happens after setup:static-content:deploy

@devgoku, manual on this feature is present in the Magento Developer Documentation.
Please refer to the Community Forums or the Magento Stack Exchange site for advice or general discussion about this issue. The GitHub issue tracker is intended for Magento Core technical issues only.

Was this page helpful?
0 / 5 - 0 ratings