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

Magento 2: Add Quantity Increment and Decrement on Category Page

Hello Magento Friends, In this blog, we will discuss about adding quantity increment and decrement…

8 hours ago

How to Integrate ChatGPT with Laravel Application?

In this guide, we'll explore how to integrate ChatGPT, an AI-powered chatbot, with a Laravel…

3 days ago

What are Net Sales? How to Calculate Your Net Sales?

In the world of business, understanding financial metrics is crucial for making informed decisions and…

6 days ago

Magento 2 Extensions Digest April 2024 (New Release & Updates)

Welcome to the MageComp Monthly Digest, where we bring you the latest updates, releases, and…

6 days ago

The ABCs of Geofencing: Definition, Features and Uses

In this era, businesses are always on the lookout for ways to engage with their…

6 days ago

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

1 week ago