cancel
Showing results for 
Search instead for 
Did you mean: 

404 error for css and js after install

404 error for css and js after install

I installed Magento 2.0 rc successfully on a bitnami wamp stack running on my windows 10 machine.  

When i try to load the front end, the css and Js do not load.

I found that this is due to the static content not deploying.  

when running

./magento setup-static:content:deploy

 

and i get the resulting error in the frontend/Magento/luma area

 

frontend/Magento/luma/en-US/css/email-fonts.less

variable @modal-slide-header__padding-vertical is undefined in _theme.less on line 254, column 37

 

the static content is not there in the front end due to this.  Please advise, thanks!

 

 

 

 

17 REPLIES 17

Re: 404 error for css and js after install

Can you try this

 

Open up

 

app/etc/di.xml and find the virtualType name="developerMaterialization"section. In that section you'll find an item name="view_preprocessed" that needs to be modified or deleted. You can modify it by changing the contents from Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink to Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

 

Delete the files under pub/static to get rid of any existing symlinks. You may want to be careful not to delete the .htaccess file.

Magento Moderator since 2009
Keep Calm and Clear Cache!

Re: 404 error for css and js after install

after editing the di.xml file you suggested,

i tried again with same error. 

see error below

 

http://imgur.com/Fi1jFHt

 

EDIT: success on the backend, though!

 

 

Re: 404 error for css and js after install

My universal fix for all the «variable @modal-slide-header__padding-vertical is undefined» problems: https://mage2.pro/t/193

Re: 404 error for css and js after install

I have a similar or exact problem, after a clean installation, my .js files got a 404, many files are missing, I tried already to edit di.xml with no success , when I try your fix  «variable @modal-slide-header__padding-vertical is undefined» I have no files available on that directory. No idea what to do next.

 

This is my testing site: http://goo.gl/KYSVUS

 

Backend don't work after I log in.

Re: 404 error for css and js after install

Open the file “app/etc/di.xml” and locate the coding section from 573

 

Change: “Symlink” in the above with “Copy”

The following XML snippet is the correct:

 

<arguments>

<argument name="strategiesList" xsi:type="array">

<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>

<item name="default" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>

</argument>

That ok, Smiley Happy

Re: 404 error for css and js after install

I have the same problem 

 

and still not able to solve it, the solution above did not work for me

Re: 404 error for css and js after install

I think the problem is related to permissions. I found out that all dir and files in hub/statics are 770 and 660

 

after changing them to 755 and 644 problem solve

Re: 404 error for css and js after install

I made this change and problem continue

Re: 404 error for css and js after install

I made changes on permissions and problem continue, files go back to 0777when changed to 0644 specially files, folder continue on 0755.