When loading via webcomponents/HTML API, the builder area is not pulling in the .js that it needs to activate the components interactive features, including in this case calling the API to get the data. Also happens with sliders, etc. I’ve seen this reported in other threads with no solution other than moving to a different tech stack, which doesn’t seem to make sense.
Builder content link
Builder public api key 8db31f7e69d24ba2afde0c21f78e9022
What are you trying to accomplish e.g. I want to integrate builder on a landing page
Code stack you are integrating Builder with
HTML - not an SPA. No React, etc. Just want to pull this into the HTML with the HTML or Qwik API. Ideally will be able to call this server-side.
As you can see from the screenshot, the HTML is loading fine, but it’s not doing the data binding. On other attempts at this, I can’t get it to load the scripts to make the carousel work. I feel like I am missing a required script include, even though the Qwik docs say it will bring in any .js that it needs.
Thank you for the response, Gustavo! This is an interesting theory.
I tried calling the Qwik server side, and that had the same behavior.
What did work was changing the URL for the API that it was calling (which is hosted on my website) to go directly there and not through the builder.io proxy. The proxy is required to make it work in the editor without setting up CORS for that API, but that same proxy didn’t work from the HTML or Qwik API.
So now the API call portion works, but it still shows “missing component” for the carousel when I try and use that. And, I can’t edit anything with the URL set to the direct path, I have to set it back to the proxy path to edit, and then back to the direct path to actually see it.
FWIW, I was able to get the desired behavior on the client-side by using the webcomponents API and using the Entry ID of the page instead of the URL like this: