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

Block has encountered an error Problem #18947

Closed
RcTomcat1 opened this issue Dec 5, 2019 · 1 comment
Closed

Block has encountered an error Problem #18947

RcTomcat1 opened this issue Dec 5, 2019 · 1 comment
Labels
[Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.

Comments

@RcTomcat1
Copy link

Hi,

if we update to wp 5.3 we get a problem with some third party blocks. I am posting here because the original developer of those blocks blames it on gutenberg and does not want to help.....
I do see the problem on their end but i need a solution so maybe someone here is willing and capable of helping me out.

Error:
"This block has encountered an error and cannot be previewed"

Checking the debugging console we get:
TypeError: "$ is undefined"

$ seems to be undefined on a 5.3 system as the following output shows:
On a 5.3 system:
window.$
undefined

on a 5.2.4 system
window.$
n()

Changing $ to jQuery in the js file of the plugin makes the block editable again in the editor but leaves the message Warning: Illegal string offset ‘widgets’ in panels.php on line 976 visible on the published page. So not a real solution here. I don't know enough about gutenberg and how plugins are handled to write a proper fix for this.

Any hint on what i might do to make the plugin work with 5.3?
I would rather not have to redo all my pages before upgrading to 5.3. I will be looking for an alternative for the plugin in the near future but right now i simply don't have the time to redo everything.

@talldan
Copy link
Contributor

talldan commented Dec 16, 2019

@RcTomcat1 I did some quick searching on the origin of this, it looks like this is the result of a change WordPress core. There's some more background in this trac ticket:
https://core.trac.wordpress.org/ticket/48568

Summarizing the discussion there, it looks like window.$ was never intended to be exposed, this was the side effect of a bug in a third-party library. The plugin would have been relying on this unsupported behaviour/bug.

I imagine the right thing would be for the plugin to handle defining jquery as its own dependency. Granted there's not much you can do about this as you're not the developer, but perhaps the trac ticket will help in your discussions with the developers.

As there's nothing that can be done in this project, I'll close this issue.

@talldan talldan closed this as completed Dec 16, 2019
@talldan talldan added the [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked. label Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.
Projects
None yet
Development

No branches or pull requests

2 participants