Skip to content

Conversation

@hostep
Copy link
Contributor

@hostep hostep commented Jul 24, 2024

Description (*)

When something goes wrong when trying to load a dependency through requirejs, the error message is not very clear and it's hard to find the real problem based on the error message.

Here we improve the error message and output more detailed information about the problem, which should help frontend developers in figuring out bugs in their code.

Related Pull Requests

N/A

Fixed Issues (if relevant)

  1. Fixes Suggestion for improved error reporting for require.js loading problems #36761

Manual testing scenarios (*)

  1. Manually introduce a bug in the code: open the file app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js and add this problematic line:
--- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js
@@ -13,6 +13,8 @@ define([
     'use strict';

     return Component.extend({
+        problem: window.unexistingProp.unexistingProp,
+
         /**
          * @param {*} price
          * @return {*|String}
  1. Have a Magento shop setup with at least one saleable product in the database
  2. On the frontend, put the product in your cart and go to the checkout
  3. Look at your browsers inspector

Before the changes, not clear what the problem is:
Screenshot 2024-07-24 at 19 44 48

After the changes: a lot more clearer what the problem is:
Screenshot 2024-07-24 at 19 51 01

Questions or comments

There are almost no automated tests around this functionality, so I'm not bothering adding a test, because I don't know how I should do this.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jul 24, 2024

Hi @hostep. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.

Add the comment under your pull request to deploy test or vanilla Magento instance:
  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@hostep
Copy link
Contributor Author

hostep commented Jul 24, 2024

@magento run all tests

@engcom-Bravo engcom-Bravo added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Jul 26, 2024
@engcom-Hotel engcom-Hotel added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Jul 29, 2024
@engcom-November engcom-November self-assigned this Sep 19, 2024
@engcom-November
Copy link
Contributor

Hello @hostep,

Thank you for the collaboration and contribution!

✔️ QA Passed

Steps to reproduce:

  1. Manually introduce a bug in the code: open the file app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js and add this problematic line:
--- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js
@@ -13,6 +13,8 @@ define([
     'use strict';

     return Component.extend({
+        problem: window.unexistingProp.unexistingProp,
+
         /**
          * @param {*} price
          * @return {*|String}
  1. Go to frontend and add a product to cart.
  2. Open console on checkout page.

Before: ✖️

Log was not pointing to exact problem.
image

After: ✔️

Getting clear log of where the problem lies.
image

Since the issue linked to pr is marked as feature request moving this to on hold till we get PO confirmation on the same.

Thank you.

@engcom-Charlie
Copy link
Contributor

engcom-Charlie commented Nov 13, 2024

As we got the confirmation from Product Owner on this PR to proceed further, removing it from On hold. Moving it to Extended Testing as the build is failing.

Thank you!

@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests CE, Unit Tests

@engcom-Charlie
Copy link
Contributor

@magento run Functional Tests B2B

@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE, Unit Tests

@engcom-Charlie
Copy link
Contributor

engcom-Charlie commented Nov 19, 2024

@engcom-Charlie
Copy link
Contributor

@magento run Functional Tests B2B

@engcom-Charlie
Copy link
Contributor

engcom-Charlie commented Nov 20, 2024

@magento-devops-reposync-svc magento-devops-reposync-svc merged commit f6924b4 into magento:2.4-develop Dec 4, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for testing Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Projects

Status: Recently Merged

Development

Successfully merging this pull request may close these issues.

Suggestion for improved error reporting for require.js loading problems

7 participants