Skip to content
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

Errors from wp-hooks in WP 5.0-5.5 #6776

Closed
westonruter opened this issue Dec 8, 2021 · 9 comments · Fixed by #6782
Closed

Errors from wp-hooks in WP 5.0-5.5 #6776

westonruter opened this issue Dec 8, 2021 · 9 comments · Fixed by #6782
Assignees
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes.
Milestone

Comments

@westonruter
Copy link
Member

westonruter commented Dec 8, 2021

Bug Description

On the Settings Screen and Onboarding Wizard and AMP Customizer, I'm seeing Uncaught TypeError: Cannot read properties of undefined (reading 'wp') in WordPress 5.0-5.5:

image

Nevertheless, the screens seem to work properly.

This is low priority given the old WP version.

Expected Behaviour

No errors should occur on these screens.

Screenshots

No response

PHP Version

No response

Plugin Version

2.2

AMP plugin template mode

Standard, Transitional, Reader

WordPress Version

No response

Site Health

No response

Gutenberg Version

No response

OS(s) Affected

No response

Browser(s) Affected

No response

Device(s) Affected

No response

Acceptance Criteria

No response

Implementation Brief

No response

QA Testing Instructions

No response

Demo

No response

Changelog Entry

No response

@westonruter westonruter added Bug Something isn't working P2 Low priority labels Dec 8, 2021
@westonruter westonruter changed the title Errors from wp-hooks in WP 5.0 Errors from wp-hooks in WP 5.0-5.1 Dec 8, 2021
@westonruter westonruter changed the title Errors from wp-hooks in WP 5.0-5.1 Errors from wp-hooks in WP 5.0-5.2 Dec 8, 2021
@westonruter westonruter changed the title Errors from wp-hooks in WP 5.0-5.2 Errors from wp-hooks in WP 5.0-5.3 Dec 8, 2021
@westonruter
Copy link
Member Author

westonruter commented Dec 8, 2021

In WordPress 5.3.10 & 5.4.8, the Customizer has many more errors than just this:

image

It breaks the Customizer entirely.

@westonruter westonruter added this to the v2.2 milestone Dec 8, 2021
@westonruter westonruter removed the P2 Low priority label Dec 8, 2021
@westonruter westonruter changed the title Errors from wp-hooks in WP 5.0-5.3 Errors from wp-hooks in WP 5.0-5.5 Dec 8, 2021
@westonruter
Copy link
Member Author

westonruter commented Dec 8, 2021

The resolution for the Customizer issue should be just to disable AMP integration in WP<5.6.

Update: See #6773 (comment).

@dhaval-parekh
Copy link
Collaborator

While further debugging the issue, Found that while generating polyfill files it assigned the polyfill object into this.wp instead of global wp (or window.wp). This can be changed by removing the below line from the webpack.config.js file.

libraryTarget: 'this',

Though testing these changes with other features.

@westonruter
Copy link
Member Author

Humm. But that shouldn't matter, should it? It should be that in a browser context, this === window.

@dhaval-parekh
Copy link
Collaborator

Yes, ideally this === window by default. But when the function uses strict mode this remains undefined and has to define manually. Reference

@westonruter
Copy link
Member Author

Ah yes, I forgot about strict mode. 👍

@bartoszgadomski
Copy link
Contributor

QA results

AMP plugin version: 2.2.0-RC1-20211210T171412Z-7e67d49

Settings Screen

WordPress version Screenshot Description
5.0.3, 5.1.1, 5.2.4, 5.3.2, 5.4.2 Screenshot 2021-12-13 at 22 01 51 REST requests failed for /wp/v2/themes (400: Missing parameter(s): status) and /wp/v2/plugins (404)
5.5.3, 5.6.2 Screenshot 2021-12-13 at 22 19 32 REST request failed for /wp/v2/themes (400: Missing parameter(s): status)
5.7.2 Screenshot 2021-12-13 at 22 27 31 No issues

Onboarding wizzard

WordPress version Screenshot Description
5.0.3, 5.1.1, 5.2.4, 5.3.2, 5.4.2 Screenshot 2021-12-13 at 22 31 25 REST requests failed for /wp/v2/themes (400: Missing parameter(s): status) and /wp/v2/plugins (404)
5.5.3, 5.6.2 Screenshot 2021-12-13 at 22 36 09 REST request failed for /wp/v2/themes (400: Missing parameter(s): status)
5.7.2 Screenshot 2021-12-13 at 22 28 58 No issues

CC: @westonruter @delawski

@bartoszgadomski bartoszgadomski self-assigned this Dec 13, 2021
@delawski
Copy link
Collaborator

@bartoszgadomski Those issues are fixed in #6773. Since it's not merged yet, I think it's best to wait with the QA until it's in develop.

@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Dec 15, 2021
@delawski
Copy link
Collaborator

QA Passed

WordPress Version QA AMP Settings QA Onboarding Wizard
4.9.8 Screenshot 2021-12-15 at 11 57 21 Screenshot 2021-12-15 at 11 58 21
5.5.7 Screenshot 2021-12-15 at 11 57 51 Screenshot 2021-12-15 at 11 58 30
5.6.6 Screenshot 2021-12-15 at 11 58 05 Screenshot 2021-12-15 at 11 58 41

Version 2.2.0-RC1-20211214T235253Z-fda381f


@bartoszgadomski If you have capacity today, please confirm everything works as expected with the latest 2.2 production build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants