N
Nuxt4mo ago
CARDAMON!

Issues with Directus Cms and Nuxt

Also, I am a bit of a beginner at directus and I am using the How to use directus cms with Nuxt, and when I run my project I am getting these erorrs ARN [Vue warn]: Failed to resolve component: UApp If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at <App> at <NuxtRoot> WARN [nuxt] Your project has layouts but the <NuxtLayout /> component has not been used. WARN [Vue warn]: Failed to resolve component: UApp If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at <App> at <NuxtRoot> WARN [Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance. at <Anonymous > at <App> at <NuxtRoot> WARN [nuxt] Your project has pages but the <NuxtPage /> component has not been used. You might be using the <RouterView /> component instead, which will not work correctly in Nuxt. You can set pages: false in nuxt.config if you do not wish to use the Nuxt vue-router integration. WARN [nuxt] Your project has layouts but the <NuxtLayout /> component has not been used. WARN [Vue warn]: Failed to resolve component: UApp If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at <App> at <NuxtRoot> WARN [Vue warn]: Non-function value encountered for default slot. Prefer function slots for better performance. at <Anonymous > at <App> at <NuxtRoot> WARN [Vue warn]: Component <Anonymous> is missing template or render function. at <Anonymous > at <App> at <NuxtRoot> WARN [nuxt] Your project has pages but the <NuxtPage /> component has not been used. You might be using the <RouterView /> component instead, which will not work correctly in Nuxt. You can set pages: false in nuxt.config if you do not wish to use the Nuxt vue-router integration. what could I use to fix these errors?
3 Replies
kapa.ai
kapa.ai4mo ago
Hi @CARDAMON!. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the errors and the information from the knowledge sources, here’s how you can address the issues in your Nuxt project: 1. <NuxtPage /> and <NuxtLayout /> Not Used You are seeing warnings like:
Your project has pages but the <NuxtPage /> component has not been used.
Your project has layouts but the <NuxtLayout /> component has not been used.
This means your app.vue file is missing the required Nuxt components to render pages and layouts. In Nuxt, you must use <NuxtPage /> to display your pages and <NuxtLayout /> if you are using layouts. Do not use <RouterView /> directly, as it will not work correctly in Nuxt. How to fix: If you have both pages and layouts, your app.vue should look like this:
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>
This ensures that Nuxt can properly render your pages and layouts. If you only have pages and no custom layouts, you can use just <NuxtPage /> in app.vue:
<template>
<NuxtPage />
</template>
<template>
<NuxtPage />
</template>
See more: app.vue usage
See more: layouts usage --- 2. Failed to Resolve Component: UApp
[Vue warn]: Failed to resolve component: UApp
This warning means you are trying to use a component called UApp that Nuxt cannot find. This could be because: - You have not installed the UI library that provides UApp. - You have not registered the component globally or imported it locally. - You have a typo in the component name. How to fix: - Double-check if you are using a UI library (like Nuxt UI or another) that provides UApp. If so, ensure it is installed and configured. - If you do not intend to use UApp, remove it from your templates. - If you do, make sure to import it or register it as needed. --- 3. Non-function Value Encountered for Default Slot
[Vue warn]: Non-function value encountered for default slot.
This usually happens if you are passing a value to a slot that expects a function. Review your slot usage and ensure you are using the correct syntax. --- 4. Component Missing Template or Render Function
[Vue warn]: Component <Anonymous> is missing template or render function.
This means a component is being used without a template or render function. Check your components to ensure they have a valid template or render function. --- Summary - Update your app.vue to use <NuxtPage /> and <NuxtLayout /> as shown above. - Remove or correctly import the UApp component. - Review your slot usage and component definitions for correctness. If you follow these steps, most of the warnings should be resolved. If you are following a guide for Directus and Nuxt, make sure it is up-to-date and compatible with your Nuxt version, as some guides may reference older patterns not suitable for Nuxt 3. If you need more specific help with Directus integration, please provide the relevant code or guide you are following. More on app.vue and required components
More on layouts
More on pages ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4mo ago
<@653129024570392597> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
julbd
julbd4mo ago
Hi @CARDAMON!. I have the same error. Did you find a solution ? Resolved. The issue was a .nuxtignore file left from nuxt 2 with the following content :
dist
.nuxt
dist
.nuxt
I have no idea why it silently prevented nuxt/ui components to register.

Did you find this page helpful?