Closed milindmore22 closed 1 year ago
@milindmore22 If you could use a development build of the plugin to obtain the error stack trace, you'd be able to see the error without the minified identifiers.
Error stack trace from dev build
{
"message": "Cannot read properties of null (reading 'type')",
"stack": "TypeError: Cannot read properties of null (reading 'type')\n at getSourcesFromScannableUrls (https://amp-support.rt.gw/wp-content/plugins/amp/assets/js/amp-settings.js?ver=fae98ce24e12e591e3f8:22031:20)\n at https://amp-support.rt.gw/wp-content/plugins/amp/assets/js/amp-settings.js?ver=fae98ce24e12e591e3f8:22368:112\n at updateMemo (https://amp-support.rt.gw/wp-content/plugins/amp/assets/js/amp-settings.js?ver=fae98ce24e12e591e3f8:69580:19)\n at Object.useMemo (https://amp-support.rt.gw/wp-content/plugins/amp/assets/js/amp-settings.js?ver=fae98ce24e12e591e3f8:70126:16)\n at useMemo (https://amp-support.rt.gw/wp-content/plugins/amp/assets/js/amp-settings.js?ver=fae98ce24e12e591e3f8:81765:21)\n at SiteScanContextProvider (https://amp-support.rt.gw/wp-content/plugins/amp/assets/js/amp-settings.js?ver=fae98ce24e12e591e3f8:22358:66)\n at renderWithHooks (https://amp-support.rt.gw/wp-content/plugins/amp/assets/js/amp-settings.js?ver=fae98ce24e12e591e3f8:68698:18)\n at updateFunctionComponent (https://amp-support.rt.gw/wp-content/plugins/amp/assets/js/amp-settings.js?ver=fae98ce24e12e591e3f8:71069:20)\n at beginWork (https://amp-support.rt.gw/wp-content/plugins/amp/assets/js/amp-settings.js?ver=fae98ce24e12e591e3f8:72776:16)\n at HTMLUnknownElement.callCallback (https://amp-support.rt.gw/wp-content/plugins/amp/assets/js/amp-settings.js?ver=fae98ce24e12e591e3f8:57658:14)"
}
We are getting some null sources in validation errors which are requested on-site scans.
and while checking the source type in the below lines it gives the error.
The below condition checks if sources are not empty, but there should be a guard as well to check if a source is not null.
Tested prod build for PR https://github.com/ampproject/amp-wp/pull/7406 it seems to have fixed the issue. Tested with WC version 7.2.0, 7.2.1, 7.2.2, 7.2.3
QA Passed ✅
Cross-checked the issue and the fix is working fine. After scanning the site with WooCommerce plugin and TwentyTwentytwo theme the AMP settings page was showing the error that is fixed and working as expected.
Before:
After Fix:
Bug Description
We have received two support topics Topic 1 and Topic 2 Both users are using WoCommerce 7.2.0+ and TwentyTwentyTwo 1.3 themes both users are not able to access the AMP settings
Console error
Updated WooCommerce plugin to 7.2.2 after receiving updates still seeing same issue.
The issue can be reproducible on https://amp-support.rt.gw/
Expected Behaviour
Users should be able to access AMP settings
Screenshots
PHP Version
8.1.10
Plugin Version
2.3
AMP plugin template mode
Reader
WordPress Version
6.1.1
Site Health
1) https://insights.amp-wp.org/admin/report/uuid/ampwp-8b760253-6821-5d21-b1d1-07872a1534a2 2) https://insights.amp-wp.org/admin/report/uuid/ampwp-aa765171-787b-551e-a79c-0cbf70e9acf9
Gutenberg Version
No response
OS(s) Affected
All
Browser(s) Affected
All
Device(s) Affected
All
Acceptance Criteria
No response
Implementation Brief
No response
QA Testing Instructions
No response
Demo
No response
Changelog Entry
No response