Builder content link
Builder public api key
9c477fefb92c46b68a5bd05ea08879e8
What are you trying to accomplish
I successfully integrated the Builder.io Visual Editor on a vanilla html/JS/Vue.js page using a Vue.js instance & the browser build of @builder.io/sdk-vue. See this previous post how to do this. In this case I just used plain html, but the same principle can be used for other server-side pages like PHP pages.
The issue is that I’d like to use my Vue.js components as custom components in my Builder content sections. But my Vue.js components don’t appear as custom components in Builder.io’s Visual Editor.
I created a basic Builder.io CMS vanilla html & JS demo project on StackBlitz.
When you download this project from StackBlitz and extract it to a local folder, you can easily run it locally after issuing a npm install
and a npm start
. When you use your localhost
url as your preview url in Visual Editor, you’ll notice that my custom component does not appear in Visual Editor for adding to Builder.io content.
You’ll notice that the Builder content works fine in a browser however, only custom components do not appear in Visual Editor. I debugged this and tried every possible solution for days but it seems the Visual Editor doesn’t recognise custom components when using the browser esm build of sdk-vue.
When I create a small Vue.js demo project using npm create vue@latest
with a custom component, this works fine: my custom component immediately appears for adding to content in the Visual Editor.
I’m thinking that the Visual Editor doesn’t find my custom components on a vanilla html page when using the browser build as a script module. However debugging with Chrome’s devtools, there is not so much difference between a vanilla html page and a Vue.js project served by a npm run dev
Node.js instance.
Maybe someone has a clue about what’s going wrong? As the sdk-vue provides a browser build, I suppose it must be possible to get custom components working in a vanilla html page setup too.
Code stack you are integrating Builder with
vanilla html/js, Vue.js
Reproducible code example
The same demo project is also on CodeSandbox