1

Why does my css keep breaking and none of the clicks works in Magento2 frequently, even without any changes done in any of xml files.

Everytime I need to run php bin/magento setup:static-content:deploy, it is very frustrating.

What can I do about it?

  • You might be using the incorrect Magento mode then. Can you claridy what does "even without any changes done for any of xml files." means? – mbalparda Sep 4 '16 at 14:01
2

Some important things to consider:

  • you should work in developer mode
  • when in developer mode, do not run static setup:static-content:deploy, it will copy the files so that on the fly generation of symlinks does not work anymore.

    To make it work again, delete pub/static/frontend and pub/static/adminhtml. Do not delete the whole pub/static directory, because the .htaccess file is important for the developer mode to work.

    See also: Which compilation commands are needed in developer mode and when?

  • The webserver user must have permissions to create symlinks in pub/static. This is especially problematic if it runs on Windows.

1

I had the same issue, try putting the magento into development mode.

bin/magento deploy:mode:set developer

I also found that i needed to make sure i set the correct permissions on files to allow read write.

Also make sure you flush the cache.

 cache:clean                               Cleans cache type(s)
 cache:disable                             Disables cache type(s)
 cache:enable                              Enables cache type(s)
 cache:flush                               Flushes cache storage used by cache type(s)

Hope this helps.

  • Permissions are already set and im already in Dev mode – Sushivam Sep 4 '16 at 14:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.