Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [static-content]

Denotes questions related to Static Content in Magento2.

29
votes
7answers
35k views

magento2: how can i deploy my theme only

I was using this for deploy the content but it is taking too much time. php bin/magento setup:static-content:deploy then i figure out adding the language make fast but it still deploy all the ...
29
votes
15answers
110k views

Magento 2 CSS and JavaScript not loading from correct folder

I am hoping that someone on here can help. I am attempting to install and run Magento 2 on WAMP on a Windows 7 machine with little success. After jumping through the many and various hoops to get ...
25
votes
4answers
4k views

Which compilation commands are needed in developer mode and when?

Can somebody give me instructions when to run which compilation commands in Magento 2 developer mode? I'm not sure if I understand it right yet. In the devdocs, developer mode is described as follows:...
22
votes
6answers
20k views

Static Content is not loading after upgrade

After upgrade from the Magento 2.1.0 to the Magento 2.1.3 (using composer) static content is not loading anymore. In the browser console I can see that all files is unavailable (404): I don't see ...
18
votes
13answers
28k views

Missing write permissions in directory pub/static when run bin/magento setup:upgrade

The day before, I updated a new module and it was working normally. Now, when I run bin/magento setup:upgrade, I receive the below Exception. I tried setting permissions to 777 (or 770) for the pub ...
15
votes
2answers
3k views

Magento 2: Different static-content Files Per Locale?

In Magento 2, a static content URL looks like this http://magento-2-with-keys.dev/static/adminhtml/Magento/science/en_US/Pulsestorm_FrontendTutorial1/hello.js This includes a en_US locale portion. ...
13
votes
6answers
11k views

Strange Error when running setup:upgrade after module installation

I have tried to install wyomind google shopping and have the following error when running bin/magento setup:upgrade. [UnexpectedValueException] Unable to retrieve deployment version of static files ...
11
votes
3answers
2k views

Use “ifconfig” to conditionally add CSS assets

Is there any way to use ifconfig in Magento 2 to conditionally add CSS assets, similar to Magento 1? Here's an example from Magento 1: <action ifconfig="config_path/group/field" method="addItem"&...
9
votes
1answer
3k views

@media-common - Why do we need to use this?

In the Magento 2 lib documentation it contains the following: @media-common: true|false - sets whether to output common styles. For common styles every time you want to add some styles you should use ...
8
votes
2answers
4k views

Get URL of the static content folder (for backend)

Inside a block class which is being used to render a button in the admin panel, how to get the URL of the static content folder? Specifically, URL of the folder with images? For example, in ...
7
votes
2answers
9k views

Magento 2 - How to view static content deploy errors

When I run php bin/magento setup:static-content:deploy I have had some errors in my theme. I have got to the bottom of them but it was a pain, I had to manually go through all my LESS files to check ...
7
votes
1answer
1k views

Magento 2 setup:static-content:deploy symlinks

When removing all the pub/static files in Magento 2 and opening the homepage, the files are generated as symlinks. When using the command setup:static-content:deploy the files are copied, even after ...
7
votes
3answers
915 views

static-content deploy error

running static-content:deploy on multi store-view, fails with following error variable @media-common is undefined on theme where the language en_US
6
votes
2answers
1k views

Magento 2: Work Around for Loading Static Assets from Symlinks?

I just discovered that the official Magento 2.0 release (post public beta) doesn't support loading static assets from a symlinked folder. The root of the problem appears to be here #File: vendor/...
5
votes
3answers
9k views

There are no commands defined in the “setup:static-content” namespace

There are no commands defined in the "setup:static-content" namespace. Did you mean one of these? setup setup:config setup:cron setup:db-data setup:db-schema setup:db setup:di setup:...
5
votes
2answers
2k views

How to get url for static image file in Magento2 javascript files?

Say you have a js file in your module: MyModule/view/frontend/web/js/. How would you reference the image found in MyModule/view/frontend/web/images/? A solution would be this one, but looks wrong and ...
5
votes
2answers
2k views

Knockout HTML template being cached

Does anyone know how to stop Knockout HTML templates from being cached (for dev purposes)? I don't have this issue with any other files (CSS, PHTML, XML, JS), it only happens with HTML templates. As ...
5
votes
2answers
1k views

Magento 2: Nginx pub/static not autogenerating, only works with command line static-content:deploy

I have tried many of the solutions from: Local installation of Magento 2 doest not generate files in the pub/static folder and similar posts: I am in developer mode (verified in command line, and I ...
5
votes
1answer
11k views

php bin/magento setup:static-content:deploy production site

Currently in Stores > All Stores I have one store view (Dutch). When I do command php bin/magento setup:static-content:deploy it generates files for en_US. I know with the command php bin/magento ...
4
votes
6answers
4k views

Magento 2 How to make magento not to cache static content of Checkout module?

I'm modifying the checkout process, every time I edit a html file or a javascript file, I must use the command magento setup:static-content:deploy because the html or javascript is cached by magento. ...
4
votes
3answers
3k views

After changing default theme to custom theme contents and blocks missing

While developing custom theme when initialized my new theme from content -> theme -> selected my own theme after that my site content are missing. But when i select some dropdown menu i can able to ...
4
votes
2answers
2k views

Magento 2: Static files are present but shows 404

I installed Magento 2 in my local environment and executed each command: php bin/magento cache:clean php bin/magento setup:upgrade php bin/magento setup:di:compile php bin/magento ...
4
votes
4answers
217 views

Css not working after Magento 2 installation on AWS

I've installed Magento 2 on AWS, however, the admin page is appearing like this: What should I do? Thanks!
3
votes
5answers
4k views

Magento2 does not showing images/css/js

I have installed Magento 2 but for some reason all the css/js/images are not loaded. Below are the steps I follow to install Magento 2 Create a sub-domain on cpanel Downloaded Magento and uploaded ...
3
votes
3answers
4k views

Custom theme - styles-m.css failed to open stream: No such file or directory

When setting up a new custom theme that has Magento/blank as a parent, we were able to deploy static assets locally but deploying to our staging site failed with an error. [Magento\Framework\...
3
votes
2answers
10k views

Fatal error: Class 'Locale' not found magento 2.0.2 [closed]

when I run this command static-content:deploy then I got the below error "PHP Fatal error: Class 'Locale' not found in /opt/lampp/htdocs/magento/magento2_1/vendor/magento/framework/Locale/...
3
votes
2answers
320 views

Magento 2: What's the `Magento` in a Static Asset URL?

In Magento 2, a static asset URL from a module looks like this http://example.magento.com/static/frontend/Magento/blank/en_US/Pulsestorm_FrontendTutorial1/hello.js What's the Magento for between the ...
3
votes
2answers
573 views

Magento 2 : Custom Layout for Static Page Empty Into Frontend

I've create a custom layout for static page into Magento 2. app/design/frontend/VENDOR/THEME/Magento_Cms/layouts.xml <page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
3
votes
2answers
3k views

Error while sending QUERY packet on static-content:deploy

I get the following error when I use static-content:deploy -vvv. How can I remedy this? If it is an issue with SQL max_allowed_packet, I am on a shared server so cannot change this myself, but may be ...
3
votes
1answer
239 views

Magento 2 - CMS Content Won't Save

I'm having a crazy issue where I'm trying to copy over CMS content and it seems that when there are certain words, the content does not save. It just refreshes the admin page and brings me back to ...
3
votes
2answers
1k views

Magento 2: Is deploying static content necessary in developer mode? [duplicate]

Some threads say compilation is not necessary in developer mode, what about static-content:deploy? When I working on magento 2 modules, I often have problems getting my changes updated in the front ...
3
votes
0answers
774 views

Magento 2 - Unable to resolve the source file for image

I have created an image and have uploaded this to my theme/web/images folder. I have then ran the following: php bin/magento setup:static-content:deploy However I cannot get the image to show on ...
2
votes
9answers
4k views

Magento 2.1.3 static content issue

I have installed Magento 2.1.3 , After that i reload the page, css and js not loading so, I remove pub/static content then, regenerate the static content, after that I checked css url path http://...
2
votes
2answers
2k views

how to speed up static content deploy for development

Especially after changing .html knockout js template files I have to always deploy static content with bin/magento setup:static-content:deploy <languages>. This makes development very slow. I ...
2
votes
2answers
138 views

static content deploy issues

I'm having major issues with the static content deploy command because it doesn't give any errors but it isn't fixing my issue. Here is what my website looks like currently: Here are the results of ...
2
votes
1answer
3k views

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

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 ...
2
votes
1answer
1k views

Unable to find styles-l.css original path in custom theme

I want to add/modify some styles to styles-l.css, but i am unabl to identify the original path location, as i mentioned the below static content file path. pub/static/frontend/Smartwave/porto/en_US/...
2
votes
1answer
2k views

No progression after static-content:deploy en_GB

Running bin/magento setup:static-content:deploy en_GB and bin/magento setup:static-content:deploy however in both cases it randomly stops and doesn't carry on any further, I'm unable to use ctrl C in ...
2
votes
2answers
36 views

Overriding Magento 2 static adminhtml backend isn't working

I've got file : "vendor/magento/module-ui/view/base/web/templates/grid/listing.html" after deploy this file create: "pub/static/adminhtml/Magento/backend/en_US/Magento_Ui/templates/grid/listing....
2
votes
1answer
418 views

static-content:deploy not working

I'm overriding a core JS file in my module. When I run php bin/magento static-content:deploy and refresh the page the JavaScript does not seem to change. I started tracking the issue. I found ...
2
votes
1answer
565 views

Change background color Magento 2 header panel and compile less on Staging server

In /app/design/frontend/MyThemeName/my-theme/web/css/source/_theme.less I added @header-panel__background-color: @color-green-green1; To change the background color of the header panel (I have a ...
2
votes
1answer
970 views

Magento2 not auto generate static files

i've some issues with auto generating static files in pub/static folder after use magento setup:static-content:deploy if i delete some static file generated by deploy like css and i point to the url ...
2
votes
2answers
18 views

Page Styling (css) does not appear in the new Theme implementation (descendant of Luma Theme)

I just created empty theme which is descendant of Luma theme. but unfortunately the styling is not appear: theme.xml <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2
votes
1answer
30 views

Does indexer:reindex need “var”, “generated” and “pub/static” to be writable?

I would like to know if, when doing "php bin/magento indexer:reindex" the folders "var", "generated" and "pub/static" have to be writable ? Alternatively, does reindexing only work at database level? ...
2
votes
1answer
580 views

failed to open stream: No such file or directory for static-content deploy

I have recently added a new root source css file for magento storefront by putting it in default_head_blocks.xml throught below statement. <css src="css/custom.css"/> Now I ran upgrade command ...
2
votes
3answers
564 views

Magento CSS Not Loading Error

I have tried every suggestion that is out there but im still getting this error In my config data they are figured as: i have tried the solutions none of them are working im still getting the same ...
2
votes
3answers
458 views

Check if Magento 2 is using pub directory

How can we check if the website is using pub directory or not, independent of its mode? Is there any Magento function present to check the root document?
2
votes
2answers
96 views

Is static content ever stored in the di / generated folders?

I'm doing some theme development, which I am somewhat new to. I am making changes to some files, and I like to test if they can compile correctly, so I run the setup:static-content:deploy somewhat ...
2
votes
1answer
129 views

How do I view/fix errors on static-content:deploy?

I am installing a theme and when I run bin/magento setup:static-content:deploy I get an error on some of the themes eg: === adminhtml -> Magento/backend -> en_US === ... Successful: 1997 files; ...
2
votes
1answer
19 views

Magento 2.2.6 overriding css or less files or locating the actual file to edit

Not sure why i'm finding this so difficult but I have a file that has some css that needs to be fixed. The file and code are in these files: pub/static/frontend/website/mywebsite/en_US/css/styles-l....