I’m having a similar issue to this ticket. I’m using ACF and Timber with a renderCallback function. This works fine and seems to load the template on the front end but doesn’t seem to work in the editor. I get ‘Your site doesn’t include support for the “acf/[blockname]” block. You can leave this block intact or remove it entirely.’ errors in the editor even though the blocks load on the front-end. It even pulls in the field data that existed before I switched to block.json on the front-end only.
/button/block.json
{
"name": "acf/button",
"title": "Button",
"description": "A button block.",
"category": "dream",
"icon": "button",
"keywords": ["button", "buttons", "button group"],
"attributes": {
"blockId": {
"type": "string"
}
},
"usesContext": [ "buttonGroup/blockId" ],
"supports": {
"jsx": true,
"align": true,
"alignContent": true,
"alignText": true,
"anchor": true,
"className": true,
"multiple": true,
"html": false,
"inserter": true,
"color": {
"text": false,
"background": true,
"link": false,
"gradients": true,
"linkColor": true
},
"fontSize": true,
"fullHeight": false
},
"styles": [
{ "name": "default", "label": "Default", "isDefault": true },
{ "name": "other", "label": "Other" }
],
"editorScript": "file:./index.js",
"script": "file:./script.js",
"editorStyle": "file:./index.css",
"style": "file:./style.css",
"acf": {
"mode": "preview",
"renderCallback": "dream_block_render",
"postTypes": true,
"parent": "acf/button-group",
"reusable": true
}
}
I also get a js error in the console when editing pages whether or not blocks exist on the page:
acf-pro-blocks.min.js?ver=6.0.3:formatted:783 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
at _ (acf-pro-blocks.min.js:783:51)
at Array.map (<anonymous>)
at acf-pro-blocks.min.js?ver=6.0.3:1419:24
at o (acf.min.js?ver=6.0.3:1:1417)
at Object.doAction (acf.min.js?ver=6.0.3:1:587)
at n.doAction (acf.min.js?ver=6.0.3:1:18745)
at post.php?post=1521&action=edit:3223:5
Looks like it may be related to the “attributes” key so maybe I’m just doing something wrong but I’m unsure.
Line 783 of acf-pro-blocks.min.js
for (const t in e.attributes)
0 === e.attributes[t].default.length && delete e.attributes[t].default;
e.supports.anchor && (e.attributes.anchor = {
type: "string"
});
Apparently I’m doing something wrong with the attributes in my block.json. I’m not really sure what exactly but when I removed the attributes from the block.json all of my blocks appear in the admin.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.