Skip to content

[Issue] Fix handling of mixins for modules with no dependencies defined #28340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks
ghost opened this issue May 22, 2020 · 2 comments · Fixed by #27690
Closed
4 tasks

[Issue] Fix handling of mixins for modules with no dependencies defined #28340

ghost opened this issue May 22, 2020 · 2 comments · Fixed by #27690
Assignees
Labels
Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Priority: P3 May be fixed according to the position in the backlog. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.

Comments

@ghost
Copy link

ghost commented May 22, 2020

This issue is automatically created based on existing pull request: #27690: Fix handling of mixins for modules with no dependencies defined


Description (*)

This PR addresses an issue that was outlined in #25587 (comment) and investigated by me afterwards.

This is a regression I have introduced when refactoring mixins module, but it applies only in two cases which are not present in the Magento itself:

// Module defined as anything else then a function with dependencies skipped.
define('my-module', {
  foo: 'bar'
});
// Module defined with dependencies passed as "null".
define('my-module', null, {
  foo: 'bar'
});

which both results in special case where second element of RequireJS's defQueue is null and made the script throw an error when somebody required such module.

Manual testing scenarios (*)

  1. Open the store.
  2. Open browser console.
  3. Paste and execute the following code:
define('my-module', {
  foo: 'bar'
});
require(['my-module', function(){});
  1. Verify that no error similar to TypeError: Cannot read property 'map' of null is thrown.

Questions or comments

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)
  • All automated tests passed successfully (all builds are green)
@ghost ghost added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels May 22, 2020
@ghost ghost assigned krzksz May 22, 2020
@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label May 22, 2020
@sdzhepa sdzhepa linked a pull request May 22, 2020 that will close this issue
5 tasks
@magento magento deleted a comment from magento-engcom-team May 22, 2020
@sdzhepa sdzhepa added the Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch label May 22, 2020
@magento-engcom-team
Copy link
Contributor

Based on the provided information internal tickets MC-34579 for 2.4.x were created.

@slavvka slavvka added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Jun 5, 2020
@slavvka
Copy link
Member

slavvka commented Jun 5, 2020

Hi @m2-backlog[bot]. Thank you for your report.
The issue has been fixed in #27690 by @krzksz in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Priority: P3 May be fixed according to the position in the backlog. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants