Missing registration for Box, have you included the registration in your bundle?

Missing registration for Box, have you included the registration in your bundle?

The above error is logged to the console repeatedly when trying to include Box in a custom insert menu. Is this the correct way to include ‘Box’?

Detailed steps to reproduce the bug

  Builder.register('insertMenu', {
    name: 'Builder Components',
    items: [
      { name: 'Image' },
      { name: 'Box', },
  ]
});

Screenshots or video link

Code stack you are integrating Builder with
Next.js with SSR

Hi @will yes, that does indeed look correct. I tested the exact code in my local seemingly without issue.

This error usually means there is a custom component in Builder content that is not correctly registered. Some common reasons this might throw an error are if you have changed the name of the custom component since you first published content or if the component is not imported correctly into your build.

I assume that the Box and Image components here are just meant to be the Builder-developed components, not any custom code? If there is any other custom code for Box could you include that here? Any of the issues I mentioned above that could apply?

If you have any content with the Box element, maybe try unpublishing , running a new build, and republishing and see if that helps. Feel free to share any more code that you think might be helpful. Let me know if this info is helpful in diagnosing or addressing your issue further!

Okay so yes - this has to do with an old custom component that had a defaultChildren with the name: Box. It needed to just omit the name option.

Perhaps this could be documented or have a code case for it? It is not obvious that the Box component is not an actual registered component, but a catch-all for un-named components.

Wrong

defaultChildren: [{
      '@type': '@builder.io/sdk:Element',
      component: {
         // builder.io Box has no component, it is a catchall for nameless components
        name: 'Box'
      },
}]

Correct

defaultChildren: [{
      '@type': '@builder.io/sdk:Element',
}]
1 Like