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

missing dependencies on wordpress 6.4 #168

Closed
signsi opened this issue Nov 8, 2023 · 44 comments · Fixed by #170
Closed

missing dependencies on wordpress 6.4 #168

signsi opened this issue Nov 8, 2023 · 44 comments · Fixed by #170

Comments

@signsi
Copy link

signsi commented Nov 8, 2023

Bug summary

On wordpress 6.4 our custom blocks based on genesis are no longer displayed in the editor.

  1. The first issues is that wordpress dropped lodash but genesis seems to need it, possibly without properly requesting it.
  2. The second issue is: TypeError: undefined is not an object (evaluating 'rn.debounce').

The first issues can be quickfixed by explicitly loading lodash for example a script which is loaded in the editor. We are currently still looking for quickfixes for the second issue.

Steps to reproduce

  1. Update wordpress to 6.4
  2. Check genesis custom blocks in the editor
  3. check the browser console for errors

Expected behavior

The Plugin should properly work with all stable version of wordpress.

Actual behavior

Multiple js errors. On the frontend side it still seems to work.

JS Console

TypeError: undefined is not an object (evaluating 'rn.debounce')
value — block-editor.js:2:71662
Jr — react-dom.min.js:4273
Zr — react-dom.min.js:4254:94
Gr — react-dom.min.js:4227
(anonymous function) — react-dom.min.js:5027
xl — react-dom.min.js:5051
fl — react-dom.min.js:4630:82
Nn — react-dom.min.js:1856
(anonymous function) — react-dom.min.js:4462

Additional information

Suspected cause (optional)

It looks like a missing functions (debounce). Possibly it is due to a version conflict of react dom.

Versions

  • WordPress version: 6.4
  • Genesis Custom Blocks version: 1.5.3 via wpmudev / 1.5.2 via github (both don't work, why is this discrepancy?)
  • OS: Mac
  • Browser: Safari
  • Device: MBP
@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

Hi @signsi,
Thanks for letting me know about this.

It sounds like there aren't any other plugins active on your site, right?

I'm not seeing this error, and the e2e tests are passing with 6.4.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

PS. Thanks for your very detailed report.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

Genesis Custom Blocks version: 1.5.3 via wpmudev / 1.5.2 via github (both don't work, why is this discrepancy?)

Good question, we've never released a version 1.5.3, that's strange.

@signsi
Copy link
Author

signsi commented Nov 8, 2023

Hey @kienstra

I've also informed wpengine. We have version 1.5.3 from there. What is the connection there? The error exists with all versions. I also have the error with the default theme and without other plugins.

Regarding lodash, the clean solution is probably that the dependency is explictly specified. Lodash is still available in the core, but is no longer automatically enqueued.

I've just downloaded the version from the repo here. So far updates of the wordpress / react dependencies have not helped so far.

@signsi
Copy link
Author

signsi commented Nov 8, 2023

Quick update: The problem with lodash seems to be due to a combination of genesis custom blocks and our theme (since 6.4). However, the problem with the debounce always exists.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

I've also informed wpengine. We have version 1.5.3 from there. What is the connection there?

Ah, so that's Genesis Custom Blocks Pro. This repo is for the free version deployed to wp.org.

Genesis Custom Blocks Pro also runs GCB free, though.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

Regarding lodash, the clean solution is probably that the dependency is explictly specified. Lodash is still available in the core, but is no longer automatically enqueued.

Hm, GCB enqueues lodash, I'm not sure what more we can do with that.

@signsi
Copy link
Author

signsi commented Nov 8, 2023

Regarding lodash, the clean solution is probably that the dependency is explictly specified. Lodash is still available in the core, but is no longer automatically enqueued.

Hm, GCB enqueues lodash, I'm not sure what more we can do with that.

That issue was not related to the plugin.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

Ah, thanks.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

I'm looking at rn.debounce, it's hard to see where that's coming from.

@signsi
Copy link
Author

signsi commented Nov 8, 2023

I was also able to reproduce the error on a bare WP installation on a standard web server. So I'm pretty sure it's due to the combination of WP 6.4 and Genesis Custom Blocks.

TypeError: undefined is not an object (evaluating 'rn.debounce')
value — block-editor.js:2:71662
Jr — react-dom.min.js:10:80732
Zr — react-dom.min.js:10:80492
Gr — react-dom.min.js:10:80026
(anonymous function) — react-dom.min.js:10:91529
xl — react-dom.min.js:10:92040
fl — react-dom.min.js:10:85811
Nn — react-dom.min.js:10:32476
(anonymous function) — react-dom.min.js:10:83229

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

OK, thanks. I don't see that error.

Would you be able to run this plugin from source to see if that gives a better error message?

git clone https://github.com/studiopress/genesis-custom-blocks
cd genesis-custom-blocks
nvm use && npm ci && npm run dev

@signsi
Copy link
Author

signsi commented Nov 8, 2023

I'm looking at rn.debounce, it's hard to see where that's coming from.

I totally agree. Tried it some hours ago myself.
Not sure if this helps but: When I create a new page and insert the block, everything seems to be correct. Only when I click out or save does the error appear.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

Only when I click out or save does the error appear.

OK, thanks. I'll do that.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

Sorry, still not seeing the error. I'll think about this today.

@signsi
Copy link
Author

signsi commented Nov 8, 2023

I tried the same thing today. But I used the build instead of the dev server.
So the plugin runs from the source code, in dev mode. The error has changed. We are back to lodash.

TypeError: undefined is not an object (evaluating 'lodash__WEBPACK_IMPORTED_MODULE_8__.debounce')
componentDidMount — server-side-render.js:64
Jr — react-dom.min.js:10:80732
Zr — react-dom.min.js:10:80492
Gr — react-dom.min.js:10:80026
(anonymous function) — react-dom.min.js:10:91529
xl — react-dom.min.js:10:92040
fl — react-dom.min.js:10:85811
Nn — react-dom.min.js:10:32476
(anonymous function) — react-dom.min.js:10:83229

@signsi
Copy link
Author

signsi commented Nov 8, 2023

Here you will find the source code. It is from the package @wordpress/server-side-render in version 1.19.5.

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

Wow, great find.

So debounce is undefined.

@signsi
Copy link
Author

signsi commented Nov 8, 2023

Yes, that's how it looks at the moment. I'll take another deep dive into the matter tomorrow.
Thanks Ryan!

@kienstra
Copy link
Contributor

kienstra commented Nov 8, 2023

Thanks, talk to you tomorrow!

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

The e2e tests are showing the same error about debounce.

@signsi
Copy link
Author

signsi commented Nov 9, 2023

Hey Ryan
Great, so now we have confirmation that it's not just down to our setup. I'll get back to you later.
Thanks!

@signsi
Copy link
Author

signsi commented Nov 9, 2023

We've just discussed the issue internally. This warning could potentially be related as the refactoring to hooks also concerned these (or at least related) packages:
wp.compose.withState is deprecated since version 5.8. Please use wp.element.useState instead.

@signsi
Copy link
Author

signsi commented Nov 9, 2023

To be more precise: the warning clearly comes from wp core.

@signsi
Copy link
Author

signsi commented Nov 9, 2023

Work in progress: Testing @wordpress/server-side-render@4.3.8. Currently it looks much better. Doing some proper testing now. In Version 4.3.8 the refactoring to hooks is present.

@fabiankaimer
Copy link

Hi guys,
just wanted to let you know that I experience the exact same issue as @signsi with Wordpress 6.4.1 and Genesis Custom Blocks 1.5.2:

image

Downgrading Wordpress back to 3.6.x does resolve the issue temporarily. Thanks already to you for taking care of this!

@signsi
Copy link
Author

signsi commented Nov 9, 2023

Hello @fabiankaimer
Thanks for letting us know. Our manual tests in Wordpress look good so far. I am working on running the e2e tests.

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

Hi @signsi,
What does it show when you enter lodash in the JS console?

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

Does this .zip fix it on your site?

genesis-custom-blocks.1.5.2.zip

It's from #170, which at least passes the e2e tests.

@vishu87
Copy link

vishu87 commented Nov 9, 2023

Hi @kienstra

I was also facing this issue, but replacing the plugin which this zip file removes the problem for me on WP 6.4.1

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

@vishu87,
Thanks a lot for testing that, good to hear.

@signsi
Copy link
Author

signsi commented Nov 9, 2023

@kienstra same for me. ✅

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

@signsi,
Great to hear, thanks a lot for testing it and reporting this.

@signsi
Copy link
Author

signsi commented Nov 9, 2023

Thanks, for the PR @kienstra . Thanks, for the PR. So it was really missing JS dependencies, more precisely lodash?

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

Yeah, it was missing lodash, you called it 😄

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

I might not release this fix to wp.org until next week, Thursday is getting a late for a release 😄

@signsi
Copy link
Author

signsi commented Nov 9, 2023

Sure, no worries. Thanks Ryan. For the pro-version it might take even more time, right?

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

For the pro-version it might take even more time, right?

No, I'll release the Pro version the same day as the free version.

@bringsonline
Copy link

Replacing the plugin with the one in the zip-file worked for me as well, problem solved. Thanks a lot @kienstra

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

Thanks, @bringsonline! Great to hear.

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

Hi @signsi,
The fix for this is released in Genesis Custom Blocks free and Pro 1.6.0.

In wp-admin/plugins/php, you should see a notice soon to update your GCB Pro to 1.6.0.

@fabiankaimer
Copy link

Thanks for the quick fix. Works again for me as well!

@kienstra
Copy link
Contributor

kienstra commented Nov 9, 2023

Thanks, @fabiankaimer! Good to hear!

@signsi
Copy link
Author

signsi commented Nov 10, 2023

Hi @signsi, The fix for this is released in Genesis Custom Blocks free and Pro 1.6.0.

In wp-admin/plugins/php, you should see a notice soon to update your GCB Pro to 1.6.0.

Great, thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants