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

Fix an error where calypsoifyGutenberg global object was undefined #37900

Merged

Conversation

noahtallen
Copy link
Contributor

@noahtallen noahtallen commented Nov 23, 2019

We tried to reference the global declaration even though it was undefined.

To fix, we reference it directly from the window object, which declares the variable and sets its value to undefined. Previously, the entire variable was undefined, causing the runtime error.

Props to @Addison-Stavlo for finding this!

Testing:

Test that the "Back" button shows up in your local install when editing an FSE page. This bug does not happen with gutenframe since the global object exists there.

We tried to reference the global declaration even though it was undefined.

To fix, we reference it directly from the window object, which declares
a variable and sets its value to undefined.
@noahtallen noahtallen added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Defect [Goal] Full Site Editing labels Nov 23, 2019
@noahtallen noahtallen requested review from Addison-Stavlo and a team November 23, 2019 01:17
@noahtallen noahtallen requested a review from a team as a code owner November 23, 2019 01:17
@noahtallen noahtallen self-assigned this Nov 23, 2019
@matticbot
Copy link
Contributor

@noahtallen noahtallen changed the title Fix an error where calypsoifyGutenberg global objectwas undefined Fix an error where calypsoifyGutenberg global object was undefined Nov 23, 2019
@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Contributor

@Addison-Stavlo Addison-Stavlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good now. Nice easy fix!

I was not expecting to see this error given how you had the if statement set up, thats an interesting case for sure.

@noahtallen noahtallen merged commit 1e25cbf into master Nov 23, 2019
@noahtallen noahtallen deleted the fix/global-object-runtime-err-calypsoify-gutenberg branch November 23, 2019 19:56
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants