NuxtN
Nuxt10mo ago
5 replies
Howler

defineProps not auto imported?

I am new to Nuxt and Vue. I have setup a new Nuxt v3.16.1 project. Created a default.vue layout with some additional components.
However, when I try to use defineProps, I am receiving the following error message:

Cannot find name 'defineProps'.
Here is the script code:
<script setup lang="ts">

import ThemeToggle from "./ThemeToggle.vue";

defineProps<{ isSidebarOpen: boolean }>();
defineEmits(["toggle-sidebar"]);
</script>


I also seem to get messages about components being imported but not used, when they are clearly used in the template section.

I assume there is additional configuration for this?

Sorry if this is a noobie question, but I really like where Nuxt is and where its going and just want to get past these issues.

Thanks!
Was this page helpful?