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

TypeError: (0 , b.useId) is not a function #46737

Closed
ddyok opened this issue Dec 22, 2022 · 37 comments · Fixed by #46768
Closed

TypeError: (0 , b.useId) is not a function #46737

ddyok opened this issue Dec 22, 2022 · 37 comments · Fixed by #46768
Assignees
Labels
[Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended

Comments

@ddyok
Copy link

ddyok commented Dec 22, 2022

Hi,

I'm using Gutenberg 14.8.0; Wordpress 6.1.1.

I get this error when I try to save a draft or update a post:

TypeError: (0 , b.useId) is not a function
    at tm (.../wp-content/plugins/gutenberg/build/components/index.min.js?ver=c2165e5c3ae766fe35c4:1:243490)
    at ft (.../wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=6.1.1:1:43415)
    at as (.../wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=6.1.1:1:111109)
    at Fr (.../wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=6.1.1:1:77616)
    at Dr (.../wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=6.1.1:1:77544)
    at Rr (.../wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=6.1.1:1:77407)
    at Nr (.../wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=6.1.1:1:74402)
    at .../wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=6.1.1:1:30158
    at unstable_runWithPriority (.../wp-content/plugins/gutenberg/build/vendors/react.min.js?ver=6.1.1:1:7431)
    at xn (.../wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=6.1.1:1:29935)

Anyone else getting this? How do I debug this?

Thank you.

@Mamaduka Mamaduka added the Needs Testing Needs further testing to be confirmed. label Dec 22, 2022
@jeffreyvr
Copy link

jeffreyvr commented Dec 22, 2022

I have the same issue with the same versions as mentioned by @ddyok.

WordPress: 6.1.1
Gutenberg: 14.8.0
Chrome: 108.0.5359.124
PHP: 8.0.19

This does not happen in Safari.

@ddyok
Copy link
Author

ddyok commented Dec 22, 2022

I'm on PHP version 8.1.2-1ubuntu2.9 (Supports 64bit values).

@ddyok
Copy link
Author

ddyok commented Dec 22, 2022

And latest Chrome.

@Mamaduka
Copy link
Member

I saw a similar error once, but it cleared after the page refresh. The error might be coming from the browser extensions. The core currently doesn't use the new useId hook.

Can you confirm whether the error is still there when opening the editor in Incognito mode or without any extensions?

@ddyok
Copy link
Author

ddyok commented Dec 22, 2022

You're right. This doesn't happen in incognito.

@ddyok
Copy link
Author

ddyok commented Dec 22, 2022

For the record: The only two extensions I have in Chrome are Antidote 11 and Enpass.

@ddyok
Copy link
Author

ddyok commented Dec 22, 2022

Interestingly, I get this error in one Wordpress installation, but not another that is the same version and on the same server, and using the same browser.

@KenichiAizawa
Copy link

I get the exact same error, but not in Safari, it seems to be a bad combination with Chrome. I don't usually use Safari, so I'm stumped.

@brentwpeterson
Copy link

brentwpeterson commented Dec 22, 2022

I am getting this error as of today on my wordpress/gutenberg

The problem happens on the Brave Browser but not with Chrome

Also does not happen using Brave Incognito

@onecarematt
Copy link

Same error, with all extensions disabled.

@CreativeDive
Copy link
Contributor

CreativeDive commented Dec 22, 2022

Same error here after updating to Gutenberg 14.8.0

Bildschirmfoto 2022-12-22 um 21 12 49

The editor crashes when the error appears.

@vinnysgreen
Copy link

I am encountering this issue in some cases but not in others. I opened a guest window in chrome, and I can save the same page that won't save in my usual window.

@Mamaduka
Copy link
Member

@jsnajdr, do you think we should release a minor plugin with exported new hooks?

@carolinan
Copy link
Contributor

I am experiencing the same error, but only on my live site: not on localhost nor on my staging site which is on the same host as the live site... 🤷‍♀️

@jsnajdr
Copy link
Member

jsnajdr commented Dec 23, 2022

@Mamaduka Seems that we forgot to update the scripts-registering code described by @youknowriad here? #45235 (comment)

Without that, Gutenberg plugin will continue to use Core's version of React, which is v17, and there's no useId there. That explains this issue, doesn't it?

@youknowriad
Copy link
Contributor

youknowriad commented Dec 23, 2022

Indeed, this seems like something we need to fix ASAP and release a patch release.

@youknowriad youknowriad added [Type] Bug An existing feature does not function as intended [Priority] High Used to indicate top priority items that need quick attention and removed Needs Testing Needs further testing to be confirmed. labels Dec 23, 2022
@youknowriad
Copy link
Contributor

That said, I've already updated the code and moved it as part of efb2fd3 so I'm not sure what's breaking here.

@tehjaymo
Copy link

tehjaymo commented Dec 23, 2022

I'm getting the same thing. Error i'm seeing is the same as OP. Latest Brave Browser (Chromium 108.0.5359.128)

@youknowriad
Copy link
Contributor

For those who are having the issue, can I ask you to clear your browse cache and try again?

@ddyok
Copy link
Author

ddyok commented Dec 23, 2022

That solves it! Thank you.

@youknowriad
Copy link
Contributor

Great thanks for checking, I'm going to push a fix anyway so it doesn't happen to more users.

@tehjaymo
Copy link

Did not solve the issue for me on Brave unfortunately. Same errors

@youknowriad
Copy link
Contributor

youknowriad commented Dec 23, 2022

I'd love confirmation from other folks (or @tehjaymo if you could try reclearing the cache, also what versions are you using of WP and Gutenberg).

I'm convinced now that it's a browse cache issue and that the #46768 should fix it.

@carolinan
Copy link
Contributor

Clearing the cache solved it for me as well.
Gutenberg 14.8.0
WP 6.1.1
Chrome Version 108.0.5359.125

@youknowriad
Copy link
Contributor

Patch release incoming in a few minutes.

@youknowriad
Copy link
Contributor

The Gutenberg 14.8.1 should be available on the repository with the browser cache fix. Thanks all.

@westerdaled
Copy link

Is this issue definitely resolved?

Unfortunately, I am still seeing this error with Gutenberg: 14.9.1

TypeError: (0 , b.useId) is not a function
    at tm (https://myblog.com/wp-content/plugins/gutenberg/build/components/index.min.js?ver=016246c57b44bfcfbbcf:1:243448)
    at we (https://myblog.com/wp-content/themes/Extra/common/scripts/react-dom.production.min.js?ver=16.14.0:84:293)
    at zj (https://myblog.com/wp-content/themes/Extra/common/scripts/react-dom.production.min.js?ver=16.14.0:226:496)
    at Th (https://myblog.com/wp-content/themes/Extra/common/scripts/react-dom.production.min.js?ver=16.14.0:152:223)
    at tj (https://myblog.com/wp-content/themes/Extra/common/scripts/react-dom.production.min.js?ver=16.14.0:152:152)
    at Te (https://myblog.com/wp-content/themes/Extra/common/scripts/react-dom.production.min.js?ver=16.14.0:146:151)
    at https://myblog.com/wp-content/themes/Extra/common/scripts/react-dom.production.min.js?ver=16.14.0:61:68
    at unstable_runWithPriority (https://myblog.com/wp-content/themes/Extra/common/scripts/react.production.min.js?ver=16.14.0:25:261)
    at Da (https://myblog.com/wp-content/themes/Extra/common/scripts/react-dom.production.min.js?ver=16.14.0:60:280)
    at Pg (https://myblog.com/wp-content/themes/Extra/common/scripts/react-dom.production.min.js?ver=16.14.0:61:14)

I have previously tried clearing:

  • Clearing browser cache
  • Post cache
  • server cache

@youknowriad
Copy link
Contributor

@westerdaled judging by your stack trace, it's seems that your theme is actually overriding the "react" and "react-dom" scripts defined by WP/Gutenberg to use an older version which causes the issue.

@westerdaled
Copy link

@youknowriad, thanks for replying. I will get this looked at and report back.

@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jan 11, 2023
@esgeeks
Copy link

esgeeks commented Jan 19, 2023

I also have this problem with Gutenberg: 14.9.1.

TypeError: Cannot destructure property 'possibleBlockTransformations' of '(0 , d.useSelect)(...)' as it is undefined.
    at Yg (..._gutenberg/build/block-editor/index.min.js:53:7754)
    at ft (..._gutenberg/build/vendors/react-dom.min.js:1:43415)
    at as (..._gutenberg/build/vendors/react-dom.min.js:1:111109)
    at Fr (..._gutenberg/build/vendors/react-dom.min.js:1:77616)
    at Dr (..._gutenberg/build/vendors/react-dom.min.js:1:77544)
    at Rr (..._/build/vendors/react-dom.min.js:1:77407)
    at Nr (..._/build/vendors/react-dom.min.js:1:74402)
    at https://...gutenberg/build/vendors/react-dom.min.js:1:30158
    at unstable_runWithPriority (https://..._gutenberg/build/vendors/react.min.js:1:7431)
    at xn (https://..._gutenberg/build/vendors/react-dom.min.js:1:29935)

I have tried all the latest versions (one by one). The last version with which I have no error is version 14.7.1.

*Tested in Safari, Chrome and Yandex. All in incognito mode.

@westerdaled
Copy link

@youknowriad @esgeeks we managed to fix this issue this morning, by deactivating the Gutenberg plugin and just using the native Gutenberg support in WordPress 6.1.1 . So is the idea of the plugin simply to get updates in between WordPress versions? Is there a table of the of the features in the native Gutenberg per WordPress version verses the version of the Plugins. I guess I am trying to work out if and when, I would want to reactivate the plugin.

@ddyok
Copy link
Author

ddyok commented Jan 19, 2023

@westerdaled 's question is relevant to me as well, as I cannot willy-nilly activate/deactivate plugins in the production environment, and this is becoming a nuisance (we're currently using copy/paste of elements instead of clicking on the block selector).

@girlg33k
Copy link

I've updated the latest version of this plugin, hoping it would resolve this issue, but it broke the editor altogether. Disabling the plugin corrected the problem, however, there are areas of the site/s that will now have to be adjusted because disabling Gutenberg has caused a few layout/style issues here and there. My point is, this issue is definitely not resolved so I'm not sure why it's closed.

@ddyok
Copy link
Author

ddyok commented Jan 20, 2023

I second @girlg33k.

@esgeeks
Copy link

esgeeks commented Feb 12, 2023

Just to comment that version 15.1.0 still does not solve the problem.

@youknowriad
Copy link
Contributor

Hello folks. If you're still experiencing the issue, can you try disabling the other plugins (not Gutenberg) or switching themes for the sake of testing to see if it solves the issue. There might be a plugin or code that is enforcing an older React version.

@hamidtech
Copy link

Just to comment that version 15.1.0 still does not solve the problem.
I still face same issue in 15.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.