-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Magnifier.js syntax error #36200
Comments
Hi @vandijkstef. Thank you for your report.
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:
For more details, review the Magento Contributor Assistant documentation. Add a comment to assign the issue: To learn more about issue processing workflow, refer to the Code Contributions.
🕙 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. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Hi @engcom-Delta. Thank you for working on this issue.
|
Hi @vandijkstef, Thank you for reporting and collaboration, Can you please provide more detail on which context you are getting error. Thanks. |
Hi @engcom-Delta, Sorry I missed your question for a bit. Basically I have another js-script running that is trying to set a variable Here's an interesting thread about the subject |
@magento give me 2.4-develop instance |
Hi @engcom-Hotel. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Hotel. Thank you for working on this issue.
|
Hi @engcom-Hotel, here is your Magento Instance: https://41efee41a835c031623b15b144cde72f.instances.magento-community.engineering |
Hello @vandijkstef, Thanks for the reporting and collaboration! We have tried to reproduce the issue on the above Magento instance and found that But still, the Image gallery is working fine for us. Can you please let us know any additional steps which we need to follow in order to reproduce the issue? Thanks |
It's highly likely to me that |
Hello @vandijkstef, Thanks for the reply! According to your comment, we have tried to reproduce the issue by following the below steps:
But I think this is not the proper way to reproduce the issue. So can you please help us in the same? Thanks |
This is the proper way to reproduce this issue. This is the proper solution. It's all about JS coding standards not being applied here. Any of the following variables will not be usable by any other module
If I look the the old version of the file (it's a few years back) you can see what was originally in there, and that a |
Hello @vandijkstef, Thanks for the update! We are confirming this issue and updating the main description with the steps mentioned here #36200 (comment) Thanks |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-7440 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue. |
This is still an issue in Mage 2.4.7 - We're talking about replacing a |
Preconditions and environment
Steps to reproduce
const data={}
in the console.3. But if replace `;` to `,` from `lib/web/magnifier/magnifier.js`, then the issue is resolved.
./lib/web/magnifier/magnifier.js 26-30 is causing an error depending on contexts
It errors out later in the script, saying I cannot redefine
const data
. This is because the list of variables starting atcurThumb
doesn't have specified what kind of var it is, thus living in global space.So a fix would either be
Or properly initiate the variables
Expected result
No JS errors
Actual result
JS breaks, product detail page image gallery is not functional anymore.
Additional information
I wouldn't know which solution is preferred which is why I just drop this as an issue with possible solutions provided. Additionally, it would be great to have proper JS linting set up, that doesn't allow global variable declaration like this.
As far as I can see, this has been an issue/unchanged for a few Magento version, it just got triggered by another module/js taking 'control' of the 'data' var-label.
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: