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

Reusable blocks are displayed as unsupported (development mode only) #32882

Closed
fluiddot opened this issue Jun 22, 2021 · 2 comments · Fixed by #32985
Closed

Reusable blocks are displayed as unsupported (development mode only) #32882

fluiddot opened this issue Jun 22, 2021 · 2 comments · Fixed by #32985
Assignees
Labels
[Block] Block The "Reusable Block" Block Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended

Comments

@fluiddot
Copy link
Contributor

fluiddot commented Jun 22, 2021

Description

After recent changes (probably related to the RN 0.64 upgrade), the reusable block is displayed as unsupported even when the block is available.

Step-by-step reproduction instructions

  1. Use a debug version that connects to the Metro server.
  2. Open a post/page that contains a reusable block.
  3. Observe that the block is displayed as unsupported.

Expected behaviour

The reusable block should be available in WP.com sites.

Actual behaviour

The reusable block is not available.

Screenshots or screen recording (optional)

Screenshot 2021-06-22 at 12 38 00

WordPress information

  • WordPress version: N/A
  • Gutenberg version: N/A
  • Are all plugins except Gutenberg deactivated? N/A
  • Are you using a default theme (e.g. Twenty Twenty-One)? N/A

Device information

  • Device: iPhone 8 (simulator)
  • Operating system: iOS 14.2
  • WordPress app version: 779bb171e889ad527cc1c311675119e6596e0127
@fluiddot fluiddot added [Type] Bug An existing feature does not function as intended Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Block] Block The "Reusable Block" Block labels Jun 22, 2021
@fluiddot fluiddot changed the title Reusable block are displayed as unsupported Reusable blocks are displayed as unsupported Jun 22, 2021
@fluiddot fluiddot self-assigned this Jun 22, 2021
@fluiddot fluiddot changed the title Reusable blocks are displayed as unsupported Reusable blocks are displayed as unsupported (development mode only) Jun 22, 2021
@fluiddot
Copy link
Contributor Author

I noticed that this issue is not happening in a recent build that points to the Gutenberg commit referenced in the description (WordPress iOS installable build) so in production, this issue can't be reproduced. Nevertheless, I'd like to investigate this further as it might be covering actual errors.

@fluiddot
Copy link
Contributor Author

fluiddot commented Jun 25, 2021

After further investigation, I find out that this issue is caused because the native.pre-render WP hook is called multiple times, in fact, it gets called for every warning and error that happens during the initialization. The first call to the hook is ok but the consecutive ones are passing the props empty, here you can check the screenshots from a debugging session:

First call - includes props:
Screenshot 2021-06-25 at 12 23 19

Second call - doesn't include props:
123413536-303b7f80-d5b3-11eb-9228-f4a525539bb7

The warning that produces the above call is produced when calling setupLocale which imports modules that contain circular dependencies.

Warning:

Require cycle: gutenberg/packages/block-library/src/index.native.js -> gutenberg/packages/block-library/src/latest-posts/index.js -> gutenberg/packages/block-library/src/latest-posts/edit.native.js -> gutenberg/packages/block-library/src/index.native.js\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Block The "Reusable Block" Block Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant