-
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
wp.data.subscribe generates Uncaught TypeError after WP v5.0 #12702
Comments
It looks like you need to add |
I'm closing for now, let me know if it doesn't fix the issue for you. Thanks |
Where's the documentation for that? and Do you mean deps while including script with wp_enqueue_script?? I've tried it but the same error Thanks bro |
In this page https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/block-tutorial/writing-your-first-block-type/#enqueuing-block-scripts it's mentioned at the end of the section. And yes, add the dependencies to your |
My bad bro, It works like Charm, I just need to include wp-data and wp-editor in deps array, But how should any developer know that?? Thanks bro |
Actually I was using wp-blocks but I've removed it after it causes an issue for scripts in front-end, The stylesheet didn't included then I modified all codes in the back-end too. But now it works in back-end but not in the front-end, But it was working when the plugin active in both. |
Describe the bug
I'm using wp.data.subscribe function to listen on changes made on PostFormat select element, but after upgrade to WordPress v5.0 and the Gutenberg plugin became inactive this code generates {Uncaught TypeError: Cannot read property 'subscribe' of undefined}
The Code like that:
The text was updated successfully, but these errors were encountered: