Having trouble getting past 404 errors with css and js.


<?xml version="1.0" ?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <css src="Vendor_Module::css/custom.css" />
        <script src="Vendor_Module::js/custom.js"/>
        <referenceContainer name="content">
            <block class="Vendor\Module\Block\Display" name="Display" template="Vendor_Module::index.phtml" />

Files are located here


static deploy doesn't seem to do the trick nor does manually clearing the cache

  • /Vendor/Module/etc is always for configuration and di files. – Vivek Kumar Oct 2 '17 at 5:27

You have to keep file inside view folder instead of etc folder. New path will be,


Run upgrade and deploy command.

php bin/magento setup:upgrade
rm -rf pub/static/frontend/* pub/static/adminhtml/* var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/composer_home
php -dmemory_limit=6G bin/magento setup:static-content:deploy
chmod -Rf 777 pub/ var/

Thank you.

  • Thanks, I was coding in the middle of the night and just couldn't see it – ert3 Oct 2 '17 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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