We attempted to reproduce the issue on our end; however, we have not been able to replicate it. Both drag-and-drop and selecting custom components appear to be working as expected in our test environment. Based on what we’ve seen so far, we suspect the cause may be related to dependencies or integration specifics in your setup.
Below is the code we tested with for reference:
<!-- pages/[...app].vue -->
<script setup>
import { Content, fetchOneEntry, isPreviewing } from '@builder.io/sdk-vue';
import { ref } from 'vue';
import { registeredComponents } from '~/utils/builder-components';
const route = useRoute();
// TO DO: Add your Public API Key here
const apiKey = "YOUR API KEY";
const canShowContent = ref(false);
const model = 'page';
// Get the path, ensuring root path is handled correctly
const urlPath = route.path === '/' ? '/' : route.path;
const { data: content } = await useAsyncData('builderData', () =>
fetchOneEntry({
model,
apiKey,
userAttributes: {
urlPath: urlPath,
},
})
);
// Check if we should show content
canShowContent.value = content.value ? true : isPreviewing(urlPath);
// Method to get registered components
const getRegisteredComponents = () => {
return registeredComponents;
};
</script>
<template>
<div v-if="canShowContent">
<Content
:api-key="apiKey"
:model="model"
:content="content"
:customComponents="getRegisteredComponents()"
/>
</div>
<div v-else>
<div class="min-h-screen flex items-center justify-center bg-gray-50">
<div class="text-center">
<h1 class="text-2xl font-bold text-gray-900 mb-4">Content Not Found</h1>
<p class="text-gray-600 mb-4">No Builder.io content found for this page.</p>
<p class="text-sm text-gray-500">Path: {{ route.path }}</p>
<p class="text-sm text-gray-500">URL Path: {{ urlPath }}</p>
<p class="text-sm text-gray-500">Content: {{ content ? 'Found' : 'Not found' }}</p>
<p class="text-sm text-gray-500">Preview Mode: {{ isPreviewing(urlPath) ? 'Yes' : 'No' }}</p>
</div>
</div>
</div>
</template>
We recommend comparing this implementation with your own to identify any differences in dependencies, imports, or configuration. We’re continuing to look into possible causes and will keep you updated.
Thanks, i checked that everything is up to date and as close as possible to your example.
But the issues still persist.
There are some Warnings in the Browser Console inside of the visual builder:
[mobx.array] Attempt to read an array index (1) that is out of bounds (1). Please check length first. Out of bound indices will not be tracked by MobX
[Vue warn]: Failed setting prop “attributes” on : value [object Object] is invalid. TypeError: Cannot set property attributes of # which has only a getter
[Vue warn]: Failed setting prop “attributes” on : value [object Object] is invalid. TypeError: Cannot set property attributes of # which has only a getter