Categories: Magento 2

Fixing: Failed to Load Resources Error After Installing Magento 2

If you experiencing the issue of “Failed to load resource: the server responded with a status of 404 (Not found)” for CSS and Js after installing Magento 2 on Wamp server windows, try following these steps.

 

Here are the steps which needs to be followed,

  1. Download Magento 2 zip from http://www.magentocommerce.com/download with sample data.
  2. Create new database in phpmyadmin,
  3. Extract zip in htdocs folder
  4. Install Magento 2, Make sure you use 127.0.0.1 instead of localhost in store URL and admin URL
  5. DO NOT run magento yet.
  6. Clear / delete caches and sessions of Magento 2. Go to following paths and delete everything:

ROOT > var > cache > *DELETE ALL*

ROOT > var > page_cache > *DELETE ALL*

ROOT > var > session > *DELETE ALL*

  1. Php.ini change max_execution_time to 500, memory_limit to 2048M, post_max_size to 2048M, upload_max_filesize to 2048M and max_file_uploads to 2048.
  1. Magento will try to create symlinks for some static resources on local server. You will need to change that behavior of Magento 2 by going to edit ROOT > app > etc > di.xml file.
  1. Open up di.xml, find the virtualType name=”developerMaterialization” section.
  1. In that section below, you will find an item <item name=”view_preprocessed” xsi:type=”object”> which needs to be modified. You can modify it by changing the following content:

Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

To:

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

  1. Delete everything from ROOT > pub > static > DELETE ALL EXCEPT .HTACCESS

Do let us know via commenting if you are still facing any issue or share your feedbacks for this.

Click to rate this post!
[Total: 24 Average: 3.8]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate ?️ Certified Magento Developer?‍?. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.?

View Comments

  • Hi, I did it but I have these problems. Do you have any idea how I could solve it?

    At the Home Page:
    Uncaught (in promise) Could not establish connection. Receiving end does not exist.
    /magentoNew/jquery.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    require.js:141 Uncaught Error: Script error for: jquery
    http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)
    /magentoNew/jquery/jquery.mobile.custom.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    require.js:141 Uncaught Error: Script error for: jquery/jquery.mobile.custom
    http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)
    /magentoNew/mage/translate-inline.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    require.js:141 Uncaught Error: Script error for: mage/translate-inline
    http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)
    /magentoNew/mage/common.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    require.js:141 Uncaught Error: Script error for: mage/common
    http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)
    /magentoNew/mage/dataPost.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    require.js:141 Uncaught Error: Script error for: mage/dataPost
    http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)
    /magentoNew/mage/bootstrap.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    require.js:141 Uncaught Error: Script error for: mage/bootstrap
    http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)
    /magentoNew/Magento_Translation/js/mage-translation-dictionary.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    require.js:141 Uncaught Error: Script error for: Magento_Translation/js/mage-translation-dictionary
    http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)
    /magentoNew/Magento_Theme/js/responsive.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    require.js:141 Uncaught Error: Script error for: Magento_Theme/js/responsive
    http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)
    /magentoNew/Magento_Theme/js/theme.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    require.js:141 Uncaught Error: Script error for: Magento_Theme/js/theme
    http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js:166)
    at HTMLScriptElement.onScriptError (require.js:1681)

    • Confirm you have done proper configuration for the database in env.php file.
      Then run the deploy and upgrade command and then check it once.

  • Wao !! applying these steps helped me out.. Now no more resource loading issue.
    But I am observing too slow in loading of admin dashboard .. Could you please suggest how to fix this ?
    Thanks a lot for your post !!

    • Slow admin shouldn't be the part of this issue, but you can make sure caching is enabled, production mode is enabled if you are not doing development.
      Setup varnish if its live store to help you with Magento performance.

  • Still not working. I've done everything as described above. But still the admin page gives a 404 error and home page loads without css and js. Good job!

  • Yes, It's worked

    Again getting site broken after refreshing page, the situation is repeating.

    Can you help me.

Recent Posts

How to Add Tooltip in Checkout Shipping Field in Magento 2?

Hello Magento Friends, In today’s blog, I will explain How to Add Tooltip in Checkout…

2 days ago

How to Integrate and Use MongoDB with Laravel?

MongoDB is a popular NoSQL database that offers flexibility and scalability when handling modern web…

3 days ago

NodeJS | Callback Function

In NodeJS, callbacks empower developers to execute asynchronous operations like reading files, handling requests, and…

4 days ago

How to Show SKU in Order Summary in Magento 2?

Hello Magento Friends, In today’s blog, we will learn How to Show SKU in Order…

6 days ago

Best Colors to Use for CTA Buttons

The "Buy Now" and "Add to Cart" buttons serve as the primary call-to-action (CTA) elements…

1 week ago

Magento 2: How to Save Custom Field Value to quote_address for Multi-Shipping Orders

Hello Magento Friends, In Magento 2, the checkout process allows customers to choose multiple shipping…

1 week ago