magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.

Home Page:http://www.magento.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Javascript files for checkout cannot be accessed, wrong src

densen45 opened this issue · comments

Preconditions and environment

  • Magento version 2.4.7
  • Deployed on a server that is reachable through the internet
  • Activate merge and minify JavaScripts
  • Deploy Mode: production
  • One page checkout
  • behind Cloudflare proxy with their Rocket Loader

Steps to reproduce

  1. Add a product to the shopping cart
  2. Proceed to checkout

Expected result

The checkout renders.

Actual result

Several Javascript files cannot be found and loading of the checkout stops with the loader gif.

Additional information

The src attribute of the <script>-HTML tags seems to be wrong for several files.

Failed GET requests from the browser console:

https://magento.domain/checkout/jquery.min.js
https://magento.domain/checkout/mage/common.min.js
https://magento.domain/checkout/mage/dataPost.min.js
https://magento.domain/checkout/mage/bootstrap.min.js
https://magento.domain/checkout/Magento_Ui/js/core/app.min.js
https://magento.domain/checkout/Magento_PageCache/js/form-key-provider.min.js
https://magento.domain/checkout/Magento_Translation/js/mage-translation-dictionary.min.js
https://magento.domain/checkout/Magento_Theme/js/theme.min.js

Corresponding <script> tags from the :

<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="jquery" src="./jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="mage/common" src="./mage/common.min.js"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="mage/dataPost" src="./mage/dataPost.min.js"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="mage/bootstrap" src="./mage/bootstrap.min.js"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="Magento_Ui/js/core/app" src="./Magento_Ui/js/core/app.min.js"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="Magento_PageCache/js/form-key-provider" src="./Magento_PageCache/js/form-key-provider.min.js"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="Magento_Translation/js/mage-translation-dictionary" src="./Magento_Translation/js/mage-translation-dictionary.min.js"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="Magento_Theme/js/theme" src="./Magento_Theme/js/theme.min.js"></script>

In my previous installation (Magento 2.4.6-p4) the src attributes contain the fully qualified path, e.g.:

<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="jquery/ui-modules/unique-id" src="https://magento.domain/static/version1715599329/frontend/<vendor>/<theme>/<locale>/Magento_Theme/js/theme.min.js"></script>

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Hi @densen45. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@magento give me 2.4.7 instance

Hi @densen45. Thank you for your request. I'm working on Magento instance for you.

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

Hi @engcom-Dash. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    1. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

@magento give me 2.4.7 instance

Hi @densen45. Thank you for your request. I'm working on Magento instance for you.

I cannot reproduce the issue on the provided Magento instance.
It's probably not a bug in general, but an issue with my setup.

Does anyone facing a similar issue or has a hint for me how to debug/solve such issue?

Hi @densen45

Thanks for reporting and collaboration.

Verified the issue on magento 2.4 dev instance but the issue is not reproducible.

We are able to place the order successfully.

Steps to reproduce

  1. Add a product to the shopping cart
  2. Proceed to checkout

Please refer the attached screenshots. Let us know if we missed anything.

Screenshot 2024-05-13 at 11 47 54 PM Screenshot 2024-05-13 at 11 48 38 PM

@engcom-Dash thank you for your investigation! You didn't missed anything.

The reason for my issue was not Magento itself, but the Cloudflare Proxy, respectively their Rocket Loader, as I described here: https://community.cloudflare.com/t/another-magento-2-4-7-csp-sri-issue-on-checkout-page/655947

I'm closing this issue.