Skip to main content
25 votes

Magento2: Re generate css file in pub/static folder

answers here don't mention that you shouldn't delete the .htaccess in the pub/static folder. to delete all files except the .htacces enter the pub/static directory and run cd ./pub/static/ find . -...
Claudiu Creanga's user avatar
25 votes

Strange Error when running setup:upgrade after module installation

In my case, I ran php bin/magento setup:static-content:deploy and the error disappeared.
Kunsal Ajay's user avatar
14 votes

Error in content deploy in magento 2.2.1

This is already answered here by @MateuszLerczak I am quoting the relevant part from the answer below: Workaround for that is remove generated data before deploy. If var/view_preprocessed exists ...
Rajeev K Tomy's user avatar
10 votes

Magento2: Re generate css file in pub/static folder

Simple way 1 In the Magento Admin. Go to System > Tools > Cache Management and click Flush Static Files Cache. Simple way 2 If you just changed the css file which already existing, what you ...
Key Shang's user avatar
  • 3,415
10 votes

Magento 2 shows 404 error and front end css crashed

After static content deploy my js and css not loading because in url deploy version is added so insert Query in my database. INSERT INTO core_config_data (scope, scope_id, path, value) VALUES ('...
Sanjay Chauhan's user avatar
10 votes

Static content deploy error after upgrading magento 2.4.3-p1 to 2.4.4

Make sure that logo of theme is here app/design/frontend/[Your Vendor]/[Theme Name]/web/images/logo.svg It is necessary. But I guess it is bug of Magento 2 with PHP 8.1
Arni's user avatar
  • 291
9 votes

Magento2: Re generate css file in pub/static folder

There is one important note to make about this question that most of the answers don't specifically point out. In your case (with the set up you are using) the reason your CSS changes aren't getting ...
circlesix's user avatar
  • 4,283
9 votes

Magento2: Re generate css file in pub/static folder

As the question is for js and css update in Magento 2 in developer mode. Updating the JS in your respected module,before refreshing page the same file from pub/static/frontend/namespace/theme/ ... ...
Kanhaiya lal's user avatar
  • 1,548
8 votes
Accepted

Magento 2: js-translation.json 404 (Not Found) on production mode

I used this command : bin/magento setup:static-content:deploy --theme=Vendor/Theme en_US -f This command created js-translation.json. This solved my problem.
Eugene Kapelko's user avatar
8 votes
Accepted

Magento 2.3: main.ERROR: Unable to resolve the source file issue

I have resolved my issue to set value 0 in 'theme' table in db for type column.
Balwant Singh's user avatar
7 votes
Accepted

Magento2 developer mode doesnt generate static files on demand

If you are in Apache: 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/...
B G Kavinga's user avatar
  • 1,266
7 votes
Accepted

Magento 2: How do you compile with you only what you want with "setup:static-content:deploy"?

If you want to compile only theme (Package/Theme) with all that belongs to it, run the command: php bin/magento setup:static-content:deploy --theme Package/Theme If you want to compile two themes, ...
St3phan's user avatar
  • 2,907
7 votes

Magento2: Re generate css file in pub/static folder

do not forget to run the grunt exec:theme, grunt less:theme commands where theme is the theme you declared in the themes.js file from the config folder of grunt ( all this is in the developer guide ) ...
Vlad Patru's user avatar
  • 1,200
7 votes

Magento 2 Theme Development - grunt watch not detecting changes of custom LESS file

Please open the file: dev\tools\grunt\configs\local-themes.js module.exports = { company_base: { area: 'frontend', name: 'Company/Base', // <--- name must match the folder ...
Black's user avatar
  • 3,350
7 votes

Static content deploy error after upgrading magento 2.4.3-p1 to 2.4.4

The issue has been caused because your custom theme doesn't have a preview image, then PHP 8.1 throws that error due to Magento core logic. Fix that by adding an image to your custom theme. For ...
Rafael Corrêa Gomes's user avatar
6 votes

Magento 2: Site not working after delete pub/static folder manually

First of all, give permission of pub and var folder Make sure you must have .htaccess file in pub/static folder. Don't remove .htaccess file from pub/static and pub folder. If you accidentally ...
Prince Patel's user avatar
  • 22.7k
6 votes

Strange Error when running setup:upgrade after module installation

It seems to have nothing to do with the google module. It can happen after any deployment; especially if you are dealing with Magento in production mode. Running bin/magento setup:upgrade removes ...
hey's user avatar
  • 1,137
6 votes
Accepted

Magento 2 shows 404 error and front end css crashed

Deploy static content using Magento 2 CLI. If you don't know how to do it, I have written everything in the answer below with the reasons why this happens and how to solve it. Please check it out: ...
Fayyaz Khattak's user avatar
6 votes

Magento 2 shows 404 error and front end css crashed

I hope this will help you If you are using wamp server on windows then C:\wamp\bin\php\php5.5.12>php.exe C:\wamp\www\<Magento root directory>\bin\magento setup:static-content:deploy in your ...
MaYaNk's user avatar
  • 1,730
6 votes

Magento2: Re generate css file in pub/static folder

Run these commands on your Magento root folder: alias mage="php -d memory_limit=-1 -f bin/magento" chmod -R 775 pub/static/ var/ pub/media/ && rm -rf var/view_preprocessed/ var/cache/ var/...
Rafael Corrêa Gomes's user avatar
6 votes

Magento2: Re generate css file in pub/static folder

Ok so based on what I have read in various other posts and my personal experience here is the process to regenerate the CSS or any Static Content: php bin/magento setup:upgrade This will wipe out ...
Vallier's user avatar
  • 221
6 votes
Accepted

Magento2 calling assets in folder pub/static/versionXXXXXXX after static content deploy

It is an magento2 feature. magento2 used to overcome the browser cache for Static content. There will be file at pub/static/.htaccess which internally rewrite all BASE_URL/pub/static/**version$...
Amit Bera's user avatar
  • 77.5k
6 votes
Accepted

Magento 2.2.2 deploy specific theme

Yes,you can do static content deploy to specific theme. php bin/magento setup:static-content:deploy --theme {yourTheme} Example if you want static content deploy for luma theme then use php ...
Amit Bera's user avatar
  • 77.5k
5 votes

Magento 2 shows 404 error and front end css crashed

have been in the same situation, and concluded it was because of deleting htaccess file also in pub/static. If using some VCS you can recover it easily or as indicated in this answer go to the ...
medmek's user avatar
  • 594
5 votes

Magento 2.3: main.ERROR: Unable to resolve the source file issue

Just in case someone else runs in to this still: For us, the parent_id:s of our custom themes were all kinds of messed up, showing up all as parent_id=1; Fixing the parent_id's from "theme"-...
user3289197's user avatar
4 votes

Magento2: Re generate css file in pub/static folder

Couldn't you just flush static cache in the admin panel and then run php bin/magento setup:static-content:deploy
babywit's user avatar
  • 649
4 votes
Accepted

Anyone know commands for Magento 1

Magento 1 doesn't have a static content deploy system, or a DI system. If you are using the compiler for magento 1 (you may not be) you can recompile with php shell/compiler.php --compile You can ...
Luke Rodgers's user avatar
  • 4,452
4 votes
Accepted

Magento 2.2 Build system

Working build system Based of issue 10041 for RC version I figure that we need to remove env.php file if exist. Second issue 11372 throwing error: Fatal error: Uncaught Error: Call to a member ...
Mateusz Lerczak's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible