Skip Navigation

[Resolved] "This block has encountered an error and cannot be previewed"

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by benL-4 3 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#1991071

I am trying to: Add a map to an existing custom template

Link to a page where the issue can be seen: hidden link

I expected to see: a map that I could configure as per your instruction video

Instead, I got: "This block has encountered an error and cannot be previewed" in the block.

I added a container then added the map and the message appeared. I have checked the support area for previous instances. There are several but none provide a solution. I have cleared the Chrome cache and data and logged back in but it's still there and I can't configure the map.

#1991215

Hello -
I logged in using these credentials, checked the Content Template editor page, and saw some JavaScript errors in the browser console related to Google's Javascript assets and Maps APIs:

Uncaught ReferenceError: google is not defined
- load-scripts.php?c=0&load[chunk_0]=jquery-core,jquery-migrate,utils&ver=5.7:2 
TypeError: Cannot read property 'initMapById' of undefined
- react_devtools_backend.js:2430 
net::ERR_ABORTED 404 (Not Found)
- <em><u>hidden link</u></em> 

These kinds of errors often indicate a conflict with a theme, plugin, or custom code snippet, and may indicate an optimization plugin changing the sequence of loading Google's JavaScript assets, or another system trying to connect to Google's Maps API unnecessarily. To troubleshoot the problem, I suggest the following test:
- Temporarily activate the default Twenty Twenty One theme
- Temporarily deactivate all custom code snippets in Toolset > Settings > Custom Code tab
- Temporarily deactivate all plugins except Types, Blocks and Maps.
- Clear your browser cache and try to edit the Content Template again.
- if the problem is not resolved, I'll need to take a closer look by making a clone of the site and installing it in my local test environment.
- If the problem is resolved, reactivate the inactive components one by one, testing each time, until the problem returns. Try to isolate one component causing the conflict with Toolset Maps.

Please let me know what you find out, and we can determine the best way to proceed.

#1991341

My issue is resolved now. Thank you!

I think it was the Root Relative URLs plugin. I have disabled most plugins that are not immediately required in order to lessen the risk of further problems while the site is being built.