r.replace is not a function error

Support MB Blocks r.replace is not a function error

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #47361
    alpha.mediaalpha.media
    Participant

    Hello, I am running into a strange issue when trying to use a repeater field that has a "post" type select field in it. The options load correctly in the right pane but I get an error

    r.replace is not a function from https://devsite.local/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-blocks/assets/build/index.js?ver=bbaf90a48bd595592798

    return r = r.replace(/<InnerBlocks([\s\S]*?)>/g, "<InnerBlocks$1></InnerBlocks>"),

    I wanted to report this in case anyone else is having issues getting their block preview to display properly. I keep getting an "This block has encountered an error and cannot be previewed." after typing a post name in and selecting it. Prior to selecting anything, I get a "Error loading block: The response is not a valid JSON response."

    Haven't made any changes to our block theme code in a long time and it was working fine. Just updated to WordPress 6.7.1 recently but tried rolling it back and still getting the error so it must be a recent MB Blocks Update that caused it.

    I'm not sure how I can debug it any further than what I am seeing in the console.

    #47363
    alpha.mediaalpha.media
    Participant

    You can disregard this as I fixed what the issue was being caused from. It was an issue in my render template and not setting a fallback empty array when no posts have been selected yet in the group field.

    I don't know why in the past it worked, but possibly before it returned an empty array on initial page load or something but by adding a fallback to an empty array the errors all went away.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.