Skip to content

Visualizer on WordPress 7.2-RC2: the chart block is empty in the post editor and its chart picker crashes #1413

Description

@milicavs

🧪 Visualizer on WordPress 7.2-RC2: the chart block is empty in the post editor and its chart picker crashes

In the post and page editor, the Visualizer chart block draws nothing, and opening its "Display an existing chart" picker turns the block into "This block has encountered an error and cannot be previewed". This started with WordPress 7.1, which always puts the post editor in an iframe, and it is unchanged on 7.2-RC2. The front end, the widgets editor and the classic editor still show charts.

On WordPress 7.0 (before the iframe change): the three chart blocks on the test page draw in the editor, the picker shows drawn previews, and a picked chart is kept after saving and shows on the front end.
On WordPress 7.1.5 (current release) and 7.2-RC2: none of the three blocks draws; the DataTable block shows "This block has encountered an error"; the picker crashes the block as it opens; the console logs Uncaught (in promise) Error: The container #reactgooglegraph-<n> is not defined. for each preview.

Link WordPress Bot check
WordPress 7.0 7.0.9 (Playground's 7.0) ✅ Works: on 2026-11-04, 7.0.8 drew 3 of 3 blocks in Playground and in wp-env; not rechecked today
Current release 7.1.5 ❌ Fails (wp-env today): 0 of 3 blocks drawn, picker crash
New build 7.2-RC2 (Playground's beta channel, checked today) ❌ Fails (wp-env today): 0 of 3 blocks drawn, picker crash

Setup: each link installs Visualizer 4.0.11 from wordpress.org with Twenty Twenty-One and seeds 16 charts (ids 8201-8216) and page 9002 "QA Visualizer blocks" with three chart blocks, then opens that page in the editor. Tools → QA Logs shows debug.log.
Try: look at the three chart blocks in the editor, then add a new Visualizer block, choose "Display an existing chart", and compare 7.0 with 7.1.5 or 7.2-RC2.
Without Visualizer: not applicable, it is Visualizer's own block. The block is registered with API version 1 and no block.json; since 7.1 the post editor is iframed even for such blocks, and the block's Google Charts previews look for their container in the outer page, not in the editor iframe. So this is Visualizer's to fix.
Local reproduction: wp-env on 7.1.5 with qa-wp-compat/references/fixtures/visualizer-blueprint.json (Codeinwp/qa-compatibility), open /wp-admin/post.php?post=9002&action=edit; then wp core update --version=7.2-RC2 --force and wp core update-db, and open it again.
Tracking: Codeinwp/qa-compatibility#133

Activity

  1. added theissue type on Nov 23, 2026
  2. girishpanchal30 commented on Nov 24, 2026

    @girishpanchal30
    Contributor

    I have fixed it with PR #1417

  3. milicavs commented on Nov 24, 2026

    @milicavs
    Author

    🧪 QA steps and test links

    Since WordPress 7.1 puts the post editor in an iframe, Visualizer chart blocks no longer draw in the page and post editor. Google Charts and Chart.js blocks stay empty, a Table (DataTable) block shows "This block has encountered an error and cannot be previewed", and opening "Display an existing chart" crashes the block. The front end, widgets and classic editor are not affected.

    Requires: WordPress 7.1 or newer.

    Link Build Bot check
    Reproduce the bug Visualizer 4.0.11 (released) on WP 7.1.5 ✅ Reproduced: the Google pie and Chart.js pie blocks are empty, the table block shows "This block has encountered an error and cannot be previewed"
    Verify the fix PR #1417 build 127676b (Plugins shows 4.0.11-dev.e21b97d) ✅ Fixed: the Google pie, Chart.js pie and table all draw in the editor

    In the links:

    • Steps 1 to 4 are already done, and the links open page "QA Visualizer blocks" in the editor, with three charts seeded from Visualizer's own sample data.
    • The picker (step 5) was not checked by the bot.
    • Tools → QA Logs shows debug.log.

    Reproduce on Visualizer 4.0.11 (WordPress 7.1 or newer):

    1. Visualizer → Add New Chart: create a Pie chart with Google Charts and save it.
    2. Create a Pie chart with ChartJS and a Table chart with DataTable, and save them.
    3. Pages → Add New Page, open Options → Code editor and add <!-- wp:visualizer/chart {"id":<chart ID>} /--> once per chart, using the IDs from Visualizer's chart library.
    4. Switch back to the Visual editor, publish, and reload the editor.
    5. Add a new Visualizer Chart block and click "Display an existing chart".
    • Bug: in step 4 the chart blocks are empty and the table block shows "This block has encountered an error and cannot be previewed". In step 5 the block crashes with the same error, and the browser console logs The container #reactgooglegraph-<n> is not defined.
    • Fixed: every chart draws in the editor, the picker shows drawn previews, and a picked chart is kept after saving.
    Edge cases
    • Picked chart in a new block, saved and viewed on the front end: the chart shows on the page.
    • Table chart with Responsive on: the table draws with its expand controls in the editor.
    • Appearance → Widgets with a Visualizer Chart block: the chart still draws.
    • Classic editor or [visualizer id="…"] shortcode pages: charts still show as before.
    • A WordPress 7.0 site (editor not in an iframe): chart blocks and the picker still work.

    Fix: #1417 (open)

  4. pirate-bot commented on Nov 24, 2026

    @pirate-bot
    Contributor

    QA agent — 🟡 Needs human QA · On WordPress 7.2-RC2 the Visualizer block draws charts in the iframed editor again, and the chart picker works without crashing.

    I installed WordPress 7.2-RC2 with the PR build of Visualizer and the issue's test data: 16 charts and the page with three chart blocks. In the editor, the Google pie and the DataTable block now draw, with no 'container is not defined' errors. The picker shows drawn previews, and a picked line chart stays after publishing and reloading and appears on the front end. The same site running the code before the fix drew nothing and threw the container errors, so the fix is proven. Two points still need a person: the Chart.js block's editor preview comes out as a small pie squeezed into a narrow column with blank legend labels, and the PR's DataTable end-to-end test could not run as written in this sandbox.

    Worth a human look

    1. Compare the Chart.js block preview (chart 8202) in the editor on WordPress 7.0 with 7.2-RC2: with the PR it draws as a small Google pie in a ~153px column with legend labels shown as '.', and we had no 7.0 site to check whether it always looked like this.
    2. Run the PR's 'draws DataTable charts inside the editor canvas' Playwright case in wp-env. Here the test's own 'Table' chart was saved with the Google Charts library, so it never reached a DataTable.
    3. Check the D3 chart block preview in the iframed editor. It needs a D3 chart, and none was available in this setup.
    4. Check the editor on WordPress 7.1.5, and check the widgets editor and Elementor previews. Only 7.2-RC2 and the post editor were tested.
    Checks (4 passed · 2 not tested)
    • ✅ On the same editor page 9002 the DataTable block (chart 8206) draws a table with data rows inside the editor canvas and the block does not show "This block has encountered an error".
    • ✅ Adding a new Visualizer block and choosing "Display an existing chart" opens the picker with drawn previews (Google chart SVGs and the DataTable table) and the block does not turn into "This block has encountered an error and cannot be previewed"; no "container ... is not defined" console errors.
    • ✅ Picking a Google chart (8203, line) from the picker draws it in the block, and after saving the post and reloading the editor the block still references chart 8203 and draws it.
    • ✅ The front end of the saved post from criterion 3 shows the picked chart 8203 drawn, and the front end of page 9002 still draws its three charts (8201, 8202, 8206).
    • ⏸️ On WordPress 7.2-RC2, opening page 9002 "QA Visualizer blocks" in the (iframed) block editor draws the Google Charts pie block (chart 8201, an SVG inside the editor canvas) and the Chart.js pie block (chart 8202, a drawn canvas), and the console logs no "The container #reactgooglegraph- is not defined" error.
    • ⏸️ The tests the PR adds for this area pass: the Jest test classes/Visualizer/D3Renderer/tests/container-document.test.js and the two new Playwright cases in tests/e2e/specs/gutenberg-editor.spec.js ("draws Google charts inside the editor canvas", "draws DataTable charts inside the editor canvas").

    Full report, evidence and session trail

  5. linked a pull request that will close this issueRelease #1415on Nov 25, 2026
  6. pirate-bot commented on Nov 25, 2026

    @pirate-bot
    Contributor

    🎉 This issue has been resolved in version 4.0.12 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  7. added
    released
    on Nov 25, 2026
  8. poonam279 commented on Nov 26, 2026

    @poonam279
    Contributor

    Retested on WordPress 7.2-RC3: ✅ passes now, with Visualizer 4.0.12 (the release notes list "Fixed rendering of block charts inside editor iframe"). On a site updated in place from 7.1.5 (Twenty Twenty-One, PHP 8.3), page 9002's three chart blocks are drawn in the post editor, the block's chart picker opens without "This block has encountered an error" and previews all six offered charts, the first chart is picked, drawn, kept after a reload and shown on the front end, and the block also works in the widgets editor. The same 4.0.12 passes identically on 7.1.5, so 4.0.11's failure is fixed on both versions. Everything else matched too.

    Link WordPress Bot check
    Current release 7.1.5 ✅ Works on wp-env with 4.0.12: blocks drawn, picker opens
    New build 7.2-RC2 (Playground's beta channel still serves RC2, not RC3) ✅ Works on wp-env with RC3 (the bot did not open the link)

    The Playground links install whatever Visualizer wordpress.org serves today (4.0.12). Closing is for the product team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

released

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions