Closed
Description
Bug Description
When on WordPress 5.3.8, accessing the AMP Settings screen with AMP v2.1.1 results in a blank settings screen with a JS error in the console:
rtl.js:84 Uncaught TypeError: Object(...) is not a function
at rtl.js:84
at Module../node_modules/@wordpress/components/build-module/select-control/styles/select-control-styles.js (select-control-styles.js:59)
at __webpack_require__ (bootstrap:19)
at Module../node_modules/@wordpress/components/build-module/select-control/index.js (index.js:1)
at __webpack_require__ (bootstrap:19)
at Module../node_modules/@wordpress/components/build-module/custom-gradient-picker/index.js (index.js:1)
at __webpack_require__ (bootstrap:19)
at Module../node_modules/@wordpress/components/build-module/gradient-picker/index.js (index.js:1)
at __webpack_require__ (bootstrap:19)
at Module../node_modules/@wordpress/components/build-module/index.js (index.js:1)
(anonymous) @ rtl.js:84
./node_modules/@wordpress/components/build-module/select-control/styles/select-control-styles.js @ select-control-styles.js:59
__webpack_require__ @ bootstrap:19
./node_modules/@wordpress/components/build-module/select-control/index.js @ index.js:1
__webpack_require__ @ bootstrap:19
./node_modules/@wordpress/components/build-module/custom-gradient-picker/index.js @ index.js:1
__webpack_require__ @ bootstrap:19
./node_modules/@wordpress/components/build-module/gradient-picker/index.js @ index.js:1
__webpack_require__ @ bootstrap:19
./node_modules/@wordpress/components/build-module/index.js @ index.js:1
__webpack_require__ @ bootstrap:19
./assets/src/components/loading/index.js @ amp-settings.js?ver=6b389aa5fc09f404606dae2886ade7ad:1183
__webpack_require__ @ bootstrap:19
(anonymous) @ amp-settings.js?ver=6b389aa5fc09f404606dae2886ade7ad:4267
./assets/src/settings-page/index.js @ amp-settings.js?ver=6b389aa5fc09f404606dae2886ade7ad:4476
__webpack_require__ @ bootstrap:19
2 @ module.js:22
__webpack_require__ @ bootstrap:19
(anonymous) @ bootstrap:83
(anonymous) @ bootstrap:83
The error here is originating our entrypoint. We should wrap this with a try/catch block to show an error message with the details, including a link to submit a support topic with the associated stack trace.
Note that this specific issue with WordPress 5.3.8 is fixed by #6225, but we should have such error handling regardless.
Expected Behaviour
Errors should not cause a blank screen.
Steps to reproduce
- Install WordPress 5.3.8.
- Activate AMP v2.1.1
- Access the AMP Settings screen.
Screenshots
Do not alter or remove anything below. The following sections will be managed by moderators only.