-
Notifications
You must be signed in to change notification settings - Fork 9.4k
mageSwatchRenderer is undefined on PDP #36937
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
Comments
Hi @Hoargarth. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
@magento give me 2.4-develop instance |
Hi @Hoargarth. Thank you for your request. I'm working on Magento instance for you. |
Hi @Hoargarth, here is your Magento Instance: https://d9d1a9d5bfe4d0486845cb818bc2ce33.instances.magento-community.engineering |
Hi @engcom-Dash. Thank you for working on this issue.
|
There's this file in vendor
So the question now arises, which one is correct? |
@magento give me 2.4-develop instance |
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Dash, here is your Magento Instance: https://d9d1a9d5bfe4d0486845cb818bc2ce33.instances.magento-community.engineering |
Hi @Hoargarth , Thanks for Raising this issue, Could you please provide the exact steps which you followed for this issue.Because it will helps to proceed further in this case. Thanks. |
Hi @engcom-Dash First of all, I've lowered the severity to S3 as it's not affecting the store user, but us developers. Detailed steps below:
The problem is not limited to the developer toolbar, but also happens when trying to access the 'mageSwatchRenderer' module by code in any .phtml or .js file. For example if you want to extract the selected product ID like it's being described in this article and was working at least until Magento 2.4.0 Also as I mentioned in my previous comment, I could already debug it a bit. |
@magento give me 2.4-develop instance |
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Dash, here is your Magento Instance: https://d9d1a9d5bfe4d0486845cb818bc2ce33.instances.magento-community.engineering |
Hi @engcom-November. Thank you for working on this issue.
|
✅ Jira issue https://jira.corp.adobe.com/browse/AC-8142 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-November. Thank you for verifying the issue. |
Hi @Hoargarth , |
Hi @engcom-November If so, then this issue can be closed. |
mage-SwatchRenderer is correct widget name -> you should use that name |
@dobooth |
Hi @Hoargarth , |
https://docs.swissuplabs.com/m2/argento/customization/adding-prices-to-magento-swatches/ |
mageSwatchRenderer was in old versions of Magento. So the accessing the swatch rendered was causing an 'undefined' error. Upon checking the code (with references from magento/magento2#36937), replacing mageSwatchRenderer with mage-SwatchRenderer fixes the issue.
mageSwatchRenderer was in old versions of Magento. So the accessing the swatch rendered was causing an 'undefined' error. Upon checking the code (with references from magento/magento2#36937), replacing mageSwatchRenderer with mage-SwatchRenderer fixes the issue.
Hello @Mugentoki , Thank you for the report and collaboration, We attempted to reproduce the issue in our latest version 2.4 develop but were unable to do reproduce it. Please find the attached screenshot for reference. ![]() Steps to Reproduce
We followed these steps and did not encounter any issues. Could you please recheck in the latest version of Magento and let us know if we are missing any steps to reproduce this issue? Therefore, we are marking this ticket as "Issue: Needs Update". Thank you! |
Preconditions and environment
Steps to reproduce
After setting up the fresh M2 instance with demo data
jQuery('[data-role=swatch-options]').data('mageSwatchRenderer')
Expected result
Swatch renderer should be initialized and data be accessible

Actual result
Swatch renderer is undefined

Additional information
I still had a clean installed M2 version 2.3.4 around, and there it's working just fine.
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: