Skip to content

WP Build: Page crashes with "Element type is invalid" error. #75440

Closed

Description

@dhasilva

Description

After this PR wp-build pages are breaking with the following message:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `RootSinglePage`.

Step-by-step reproduction instructions

  1. Go to a page that uses wp-build.
  2. Check the error.

A simple plugin where this can be tested: https://github.com/dhasilva/minimal-wp-build-test (ignore the "No Gutenberg" thing, it was meant to debug another issue, but serves to test this as well)

Screenshots, screen recording, code snippet

Image Image

Environment info

  • Gutenberg trunk

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    on Feb 11, 2026
  2. added
    [Feature] Rich TextRelated to the Rich Text component that allows developers to render a contenteditable
    on Feb 12, 2026
  3. added and removed
    [Feature] Rich TextRelated to the Rich Text component that allows developers to render a contenteditable
    on Feb 12, 2026
  4. ellatrix commented on Feb 12, 2026

    @ellatrix
    Member

    This sounds like either an issue with wp-build or npm packages to me (but we haven't published stable npm packages since that commit).

    But it also seems like you're overriding the private API's global? Is that expected? https://github.com/dhasilva/minimal-wp-build-test/blob/trunk/build/scripts/private-apis/index.js

    I don't know anything about wp-build, would love to have help from others familiar with it.

  5. ellatrix commented on Feb 12, 2026

    @ellatrix
    Member

    Could be related to #73379, which started bundling private-apis in wp-build, cc @youknowriad

  6. simison commented on Feb 12, 2026

    @simison
    Member

    Could it be some interplay between the two changes? We've been working with #73379 in the WP build for a while now already, and it works fine. With Gutenberg enabled, things work as long as I revert #75387 locally, but otherwise it breaks.

  7. ellatrix commented on Feb 12, 2026

    @ellatrix
    Member

    Well yes, it's because there's been no private API additions since then so the file is the same as core's

  8. ellatrix commented on Feb 12, 2026

    @ellatrix
    Member

    #75460 could fix it I think, could you test it?

  9. simison commented on Feb 13, 2026

    @simison
    Member

    @ellatrix Tested with both minimal setup and Jetpack Forms (feature flag add_filter('jetpack_forms_alpha', '__return_true');) and seeing the same issue still.

  10. dhasilva commented on Feb 18, 2026

    @dhasilva
    ContributorAuthor

    @ellatrix @youknowriad Tested #75460 with the minimal setup and the issue persists. You are right in the discussion, though, so I opened this draft to test the relative import priorities and that works for me with the minimal setup.

  11. dhasilva commented on Mar 18, 2026

    @dhasilva
    ContributorAuthor

    wp-build now does not bundle anything: #75987

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions