0

We are using Magento 2.4.5-p1

We add popper.js via a custom module but in the browser console, it is still showing -

GET `http://127.0.0.1/xyz/pub/popper.js net::ERR_ABORTED 404 (Not Found)`

Does anyone face this type of issue?

1 Answer 1

0

How you added the popper.js it looks wrong. There are many ways to add js in Magento 2. The easy one is in default_head_blocks.xml layout xml in app/design/frontend/Vendor/Theme/Magento_Theme/layout/

  <!-- The following two ways to add local JavaScript files are equal -->
        <script src="Magento_Catalog::js/sample1.js"/>
        <link src="js/sample.js"/>

Here is a similar question How to add a custom javascript to theme in Magento 2?.

4
  • I tried this also but it is not working. Commented Feb 6, 2023 at 6:27
  • try adding it with cdn Commented Feb 7, 2023 at 12:24
  • Also, try with CDN still showing - GET 127.0.0.1/xyz/pub/popper.js net::ERR_ABORTED 404 (Not Found) Commented Feb 10, 2023 at 7:47
  • When you added the popper.js with CDN, remove the one you added to get it localy. Somewhere it is configured to also get it from local files. Commented Feb 13, 2023 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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