-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
DataViews: Component crashes on interaction with UI #65126
Comments
@ryanwelcher I've setup the I don't have much time to look at this today, but wanted to ask if you could provide instructions to use the devblog-dataviews-plugin with unminified React (I've tried using Gravacao.do.ecra.2024-09-10.as.08.18.02.movThe video in the OP is a different example. Based on the console messages, the issues there may be different: I'd think your fields aren't getting proper labels/headers as React elements. Happy to take a look if setup instructions are provided. |
@gigitux and I were getting similar errors but with version We were seeing the error in In summary the error should dissipate if you run:
|
Thanks for the follow up here. This makes sense to me. |
For awareness, there's a related slack thread about this. The TLDR is: the issue is not DataViews, but how it's bundled in a WordPress environment. When one of its dependencies ( In particular, this can happen if you use the npm package but the corresponding Gutenberg release is not yet public. This is, there's a few days between the Gutenberg RC (where packages are released) and the Gutenberg release where dependencies can differ. This is my understanding so far. I'm far from an expert in this matter, but it seems an recurring issue we may have. I'm thinking we should close this issue as won't fix or repurpose it to explain/focus the bundler situation. |
The dataviews package uses the private Production plugins, when they use experimental or private APIs, always maintain some compatibility layer where a const ItemLabel = wp.components.Menu?.ItemLabel ?? wp.components.DropdownMenuV2?.ItemLabel ?? wp.components.DropdownMenuItemLabelV2; |
@mirka @ciampo @tyxla This is a very practical issue with using private APIs we could attempt to solve. It's been just addressed and closed by Riad vie the The story is that someone reads a blog post on developer.wordpress.org about DataViews, and when they want to try it out themselves, they fail miserably. Everything crashes with a mysterious error:
The reason is that Can we start with improving the DX? To at least report some sensible error? The object returned by the
Or:
This won't solve all the private API issues discussed in #66197, but it would be a tangible and valuable step forward. |
I want to link this issue to wptrainingteam/devblog-dataviews-plugin#2 in the original repository. I'll keep the conversation over there but TLDR: I'll update that repo to use what Riad implemented at #66825 so it doesn't randomly breaks with updates. |
Description
I have an admin page that is using the
<DataViews />
component. The code is based on the this Developer Blog article.On initial load, the there are a large number of console errors for JSX elements returning undefined and then when clicking on any of the controls, the app crashes with more errors.
I have tested this and it only occurs with version
4.3.0
of the package but4.2.0
works as expected. This also occurs in repo related to the articleStep-by-step reproduction instructions
Checkout the developer blog repos and install it:
Navigate to Media->Add Media from third party service
Screenshots, screen recording, code snippet
dataviews-crash.mov
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: